From 00750f85acfc79f46ec50a62b8452304a7263f8c Mon Sep 17 00:00:00 2001 From: Paul Morie Date: Mon, 30 Apr 2018 13:48:58 -0400 Subject: [PATCH] Bump cmd versions of kube dependencies to kubernetes-1.10.1 --- cmd/Gopkg.lock | 126 +- cmd/Gopkg.toml | 10 +- .../github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/purell/purell.go | 379 - .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 - .../urlesc => ghodss/yaml}/LICENSE | 23 + cmd/vendor/github.com/ghodss/yaml/fields.go | 501 ++ cmd/vendor/github.com/ghodss/yaml/yaml.go | 277 + .../github.com/go-openapi/jsonpointer/LICENSE | 202 - .../go-openapi/jsonpointer/pointer.go | 390 - .../go-openapi/jsonreference/LICENSE | 202 - .../go-openapi/jsonreference/reference.go | 156 - cmd/vendor/github.com/go-openapi/spec/LICENSE | 202 - .../github.com/go-openapi/spec/bindata.go | 260 - .../go-openapi/spec/contact_info.go | 24 - .../github.com/go-openapi/spec/expander.go | 992 --- .../go-openapi/spec/external_docs.go | 24 - .../github.com/go-openapi/spec/header.go | 195 - cmd/vendor/github.com/go-openapi/spec/info.go | 168 - .../github.com/go-openapi/spec/items.go | 229 - .../github.com/go-openapi/spec/license.go | 23 - .../github.com/go-openapi/spec/operation.go | 258 - .../github.com/go-openapi/spec/parameter.go | 301 - .../github.com/go-openapi/spec/path_item.go | 90 - .../github.com/go-openapi/spec/paths.go | 97 - cmd/vendor/github.com/go-openapi/spec/ref.go | 167 - .../github.com/go-openapi/spec/response.go | 134 - .../github.com/go-openapi/spec/responses.go | 122 - .../github.com/go-openapi/spec/schema.go | 634 -- .../go-openapi/spec/security_scheme.go | 142 - cmd/vendor/github.com/go-openapi/spec/spec.go | 86 - .../github.com/go-openapi/spec/swagger.go | 317 - cmd/vendor/github.com/go-openapi/spec/tag.go | 73 - .../github.com/go-openapi/spec/xml_object.go | 68 - cmd/vendor/github.com/go-openapi/swag/LICENSE | 202 - .../github.com/go-openapi/swag/convert.go | 188 - .../go-openapi/swag/convert_types.go | 595 -- cmd/vendor/github.com/go-openapi/swag/json.go | 295 - .../github.com/go-openapi/swag/loading.go | 74 - cmd/vendor/github.com/go-openapi/swag/net.go | 24 - cmd/vendor/github.com/go-openapi/swag/path.go | 59 - cmd/vendor/github.com/go-openapi/swag/util.go | 362 - cmd/vendor/github.com/go-openapi/swag/yaml.go | 215 - cmd/vendor/github.com/gobuffalo/envy/envy.go | 75 +- cmd/vendor/github.com/mailru/easyjson/LICENSE | 7 - .../mailru/easyjson/benchmark/data.go | 148 - .../mailru/easyjson/benchmark/data_codec.go | 6914 ----------------- .../mailru/easyjson/benchmark/data_ffjson.go | 6723 ---------------- .../mailru/easyjson/benchmark/data_var.go | 350 - .../mailru/easyjson/bootstrap/bootstrap.go | 188 - .../github.com/mailru/easyjson/buffer/pool.go | 270 - .../mailru/easyjson/easyjson/main.go | 106 - .../github.com/mailru/easyjson/gen/decoder.go | 489 -- .../github.com/mailru/easyjson/gen/encoder.go | 382 - .../mailru/easyjson/gen/generator.go | 523 -- .../github.com/mailru/easyjson/helpers.go | 78 - .../mailru/easyjson/jlexer/bytestostr.go | 24 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1141 --- .../mailru/easyjson/jwriter/writer.go | 377 - .../mailru/easyjson/opt/gotemplate_Bool.go | 79 - .../mailru/easyjson/opt/gotemplate_Float32.go | 79 - .../mailru/easyjson/opt/gotemplate_Float64.go | 79 - .../mailru/easyjson/opt/gotemplate_Int.go | 79 - .../mailru/easyjson/opt/gotemplate_Int16.go | 79 - .../mailru/easyjson/opt/gotemplate_Int32.go | 79 - .../mailru/easyjson/opt/gotemplate_Int64.go | 79 - .../mailru/easyjson/opt/gotemplate_Int8.go | 79 - .../mailru/easyjson/opt/gotemplate_String.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint16.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint32.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint64.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint8.go | 79 - .../mailru/easyjson/opt/optional/opt.go | 80 - .../github.com/mailru/easyjson/opt/opts.go | 22 - .../mailru/easyjson/parser/parser.go | 97 - .../mailru/easyjson/parser/parser_unix.go | 42 - .../mailru/easyjson/parser/parser_windows.go | 49 - cmd/vendor/github.com/mailru/easyjson/raw.go | 45 - .../github.com/mailru/easyjson/tests/data.go | 759 -- .../mailru/easyjson/tests/errors.go | 26 - .../mailru/easyjson/tests/named_type.go | 22 - .../mailru/easyjson/tests/nested_easy.go | 25 - .../mailru/easyjson/tests/nothing.go | 3 - .../mailru/easyjson/tests/omitempty.go | 12 - .../github.com/mailru/easyjson/tests/snake.go | 10 - .../github.com/markbates/inflect/helpers.go | 1 + .../github.com/markbates/inflect/inflect.go | 123 +- .../github.com/markbates/inflect/name.go | 15 +- .../github.com/mitchellh/go-homedir/LICENSE | 21 - .../mitchellh/go-homedir/homedir.go | 137 - cmd/vendor/github.com/spf13/pflag/bytes.go | 105 + cmd/vendor/github.com/spf13/pflag/count.go | 12 +- .../github.com/spf13/pflag/duration_slice.go | 128 + cmd/vendor/github.com/spf13/pflag/flag.go | 155 +- .../github.com/spf13/pflag/golangflag.go | 4 + cmd/vendor/github.com/spf13/pflag/int16.go | 88 + .../github.com/spf13/pflag/string_array.go | 8 +- .../github.com/spf13/pflag/string_slice.go | 20 + .../x/net/dns/dnsmessage/message.go | 395 +- cmd/vendor/golang.org/x/net/html/atom/gen.go | 4 +- .../golang.org/x/net/html/atom/table.go | 1100 +-- cmd/vendor/golang.org/x/net/html/node.go | 26 + cmd/vendor/golang.org/x/net/html/parse.go | 285 +- .../golang.org/x/net/http/httpguts/guts.go | 50 + cmd/vendor/golang.org/x/net/http2/server.go | 50 +- .../golang.org/x/net/http2/transport.go | 3 + .../golang.org/x/net/icmp/dstunreach.go | 8 +- cmd/vendor/golang.org/x/net/icmp/echo.go | 114 +- cmd/vendor/golang.org/x/net/icmp/extension.go | 43 +- cmd/vendor/golang.org/x/net/icmp/interface.go | 100 +- cmd/vendor/golang.org/x/net/icmp/message.go | 17 +- cmd/vendor/golang.org/x/net/icmp/multipart.go | 38 +- .../golang.org/x/net/icmp/packettoobig.go | 2 +- cmd/vendor/golang.org/x/net/icmp/paramprob.go | 8 +- .../golang.org/x/net/icmp/timeexceeded.go | 8 +- .../golang.org/x/net/internal/iana/const.go | 51 +- .../golang.org/x/net/internal/iana/gen.go | 96 +- .../x/net/internal/socket/zsys_netbsd_arm.go | 6 + .../golang.org/x/net/internal/socks/client.go | 168 + .../golang.org/x/net/internal/socks/socks.go | 265 + .../x/net/internal/sockstest/server.go | 241 + cmd/vendor/golang.org/x/net/ipv4/gen.go | 2 +- cmd/vendor/golang.org/x/net/ipv4/iana.go | 10 +- cmd/vendor/golang.org/x/net/ipv6/gen.go | 2 +- cmd/vendor/golang.org/x/net/ipv6/iana.go | 10 +- cmd/vendor/golang.org/x/net/netutil/listen.go | 36 +- cmd/vendor/golang.org/x/net/proxy/socks5.go | 216 +- cmd/vendor/golang.org/x/net/route/syscall.go | 2 +- cmd/vendor/golang.org/x/net/trace/trace.go | 59 +- .../golang.org/x/text/cmd/gotext/common.go | 3 - .../cmd/gotext/examples/extract/catalog.go | 60 +- .../text/cmd/gotext/examples/extract/main.go | 3 +- .../examples/extract_http/catalog_gen.go | 57 - .../cmd/gotext/examples/extract_http/main.go | 2 +- .../golang.org/x/text/cmd/gotext/extract.go | 59 +- .../golang.org/x/text/cmd/gotext/generate.go | 87 +- .../golang.org/x/text/cmd/gotext/main.go | 29 +- .../golang.org/x/text/cmd/gotext/rewrite.go | 2 +- .../golang.org/x/text/cmd/gotext/update.go | 52 - cmd/vendor/golang.org/x/text/doc.go | 3 - .../x/text/internal/catmsg/catmsg.go | 43 +- .../x/text/message/pipeline/extract.go | 25 +- .../x/text/message/pipeline/generate.go | 97 +- .../x/text/message/pipeline/message.go | 46 +- .../x/text/message/pipeline/pipeline.go | 371 +- .../x/text/message/pipeline/rewrite.go | 4 +- .../pipeline/testdata/test1/catalog_gen.go | 85 - .../message/pipeline/testdata/test1/test1.go | 75 - cmd/vendor/golang.org/x/tools/blog/blog.go | 29 +- .../golang.org/x/tools/cmd/godoc/autocert.go | 21 +- .../golang.org/x/tools/cmd/godoc/blog.go | 19 +- .../golang.org/x/tools/cmd/godoc/handlers.go | 1 + .../golang.org/x/tools/cmd/godoc/main.go | 23 +- cmd/vendor/golang.org/x/tools/cmd/godoc/x.go | 14 +- .../x/tools/cmd/goimports/goimports.go | 2 +- .../golang.org/x/tools/cmd/guru/referrers.go | 6 + .../cmd/guru/testdata/src/referrers/main.go | 2 + .../golang.org/x/tools/cmd/tip/talks.go | 2 +- .../x/tools/go/callgraph/cha/cha.go | 30 +- .../go/callgraph/cha/testdata/issue23925.go | 38 + .../x/tools/go/gcexportdata/gcexportdata.go | 5 +- .../gcimporter}/bexport.go | 0 .../gcimporter}/bimport.go | 130 +- .../gcimporter}/exportdata.go | 0 .../gcimporter}/gcimporter.go | 8 +- .../x/tools/go/internal/gcimporter/iimport.go | 585 ++ .../gcimporter}/isAlias18.go | 0 .../gcimporter}/isAlias19.go | 0 .../gcimporter}/testdata/a.go | 0 .../gcimporter}/testdata/b.go | 0 .../gcimporter}/testdata/exports.go | 0 .../gcimporter}/testdata/issue15920.go | 0 .../gcimporter}/testdata/issue20046.go | 0 .../gcimporter}/testdata/p.go | 0 .../gcimporter}/testdata/versions/test.go | 0 .../x/tools/go/ssa/interp/external.go | 229 +- cmd/vendor/golang.org/x/tools/go/vcs/vcs.go | 18 +- .../golang.org/x/tools/godoc/cmdline.go | 3 + .../golang.org/x/tools/godoc/dirtrees.go | 71 +- cmd/vendor/golang.org/x/tools/godoc/dl/dl.go | 39 +- cmd/vendor/golang.org/x/tools/godoc/godoc.go | 3 + cmd/vendor/golang.org/x/tools/godoc/index.go | 1 - cmd/vendor/golang.org/x/tools/godoc/pres.go | 3 + cmd/vendor/golang.org/x/tools/godoc/server.go | 17 +- .../x/tools/godoc/static/makestatic.go | 1 + .../golang.org/x/tools/godoc/static/static.go | 549 +- .../golang.org/x/tools/godoc/vfs/emptyvfs.go | 4 + .../x/tools/godoc/vfs/gatefs/gatefs.go | 4 + .../x/tools/godoc/vfs/mapfs/mapfs.go | 4 + .../golang.org/x/tools/godoc/vfs/namespace.go | 14 + cmd/vendor/golang.org/x/tools/godoc/vfs/os.go | 40 +- .../golang.org/x/tools/godoc/vfs/vfs.go | 13 + .../x/tools/godoc/vfs/zipfs/zipfs.go | 23 + cmd/vendor/golang.org/x/tools/imports/fix.go | 36 +- .../golang.org/x/tools/imports/imports.go | 8 + .../fastwalk}/fastwalk.go | 38 +- .../fastwalk}/fastwalk_dirent_fileno.go | 2 +- .../fastwalk}/fastwalk_dirent_ino.go | 2 +- .../fastwalk}/fastwalk_portable.go | 2 +- .../fastwalk}/fastwalk_unix.go | 4 +- .../golang.org/x/tools/present/parse.go | 9 + .../golang.org/x/tools/refactor/eg/eg.go | 32 +- .../golang.org/x/tools/refactor/eg/rewrite.go | 152 +- .../x/tools/refactor/eg/testdata/I1.go | 9 + .../x/tools/refactor/eg/testdata/J1.go | 10 + cmd/vendor/gopkg.in/inf.v0/dec.go | 2 +- .../yaml.v2/NOTICE} | 6 +- cmd/vendor/gopkg.in/yaml.v2/apic.go | 55 +- cmd/vendor/gopkg.in/yaml.v2/decode.go | 238 +- cmd/vendor/gopkg.in/yaml.v2/emitterc.go | 5 +- cmd/vendor/gopkg.in/yaml.v2/encode.go | 136 +- cmd/vendor/gopkg.in/yaml.v2/readerc.go | 20 +- cmd/vendor/gopkg.in/yaml.v2/resolve.go | 80 +- cmd/vendor/gopkg.in/yaml.v2/scannerc.go | 29 +- cmd/vendor/gopkg.in/yaml.v2/sorter.go | 9 + cmd/vendor/gopkg.in/yaml.v2/writerc.go | 65 +- cmd/vendor/gopkg.in/yaml.v2/yaml.go | 123 +- cmd/vendor/gopkg.in/yaml.v2/yamlh.go | 30 +- .../v1beta1/zz_generated.deepcopy.go | 5 +- .../v1alpha1/zz_generated.deepcopy.go | 8 +- .../admissionregistration/v1beta1/types.go | 10 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../v1beta1/zz_generated.deepcopy.go | 14 +- cmd/vendor/k8s.io/api/apps/v1/types.go | 2 +- .../apps/v1/types_swagger_doc_generated.go | 2 +- .../api/apps/v1/zz_generated.deepcopy.go | 32 +- .../api/apps/v1beta1/zz_generated.deepcopy.go | 26 +- .../api/apps/v1beta2/zz_generated.deepcopy.go | 35 +- .../api/authentication/v1/generated.pb.go | 962 ++- .../k8s.io/api/authentication/v1/register.go | 1 + .../k8s.io/api/authentication/v1/types.go | 61 + .../v1/types_swagger_doc_generated.go | 41 + .../v1/zz_generated.deepcopy.go | 133 +- .../v1beta1/zz_generated.deepcopy.go | 33 +- .../authorization/v1/zz_generated.deepcopy.go | 42 +- .../v1beta1/zz_generated.deepcopy.go | 42 +- .../k8s.io/api/autoscaling/v1/generated.pb.go | 1006 ++- cmd/vendor/k8s.io/api/autoscaling/v1/types.go | 63 +- .../v1/types_swagger_doc_generated.go | 30 +- .../autoscaling/v1/zz_generated.deepcopy.go | 115 +- .../api/autoscaling/v2beta1/generated.pb.go | 995 ++- .../k8s.io/api/autoscaling/v2beta1/types.go | 64 +- .../v2beta1/types_swagger_doc_generated.go | 30 +- .../v2beta1/zz_generated.deepcopy.go | 112 +- .../api/batch/v1/zz_generated.deepcopy.go | 14 +- .../batch/v1beta1/zz_generated.deepcopy.go | 15 +- .../batch/v2alpha1/zz_generated.deepcopy.go | 15 +- .../k8s.io/api/certificates/v1beta1/types.go | 2 +- .../v1beta1/zz_generated.deepcopy.go | 36 +- cmd/vendor/k8s.io/api/core/v1/generated.pb.go | 4641 +++++++---- cmd/vendor/k8s.io/api/core/v1/register.go | 2 - cmd/vendor/k8s.io/api/core/v1/types.go | 169 +- .../core/v1/types_swagger_doc_generated.go | 69 +- .../api/core/v1/zz_generated.deepcopy.go | 328 +- cmd/vendor/k8s.io/api/events/v1beta1/types.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../events/v1beta1/zz_generated.deepcopy.go | 8 +- .../v1beta1/zz_generated.deepcopy.go | 47 +- .../v1alpha1/zz_generated.deepcopy.go | 5 +- .../networking/v1/zz_generated.deepcopy.go | 8 +- .../k8s.io/api/policy/v1beta1/generated.pb.go | 3526 +++++++-- .../k8s.io/api/policy/v1beta1/register.go | 2 + cmd/vendor/k8s.io/api/policy/v1beta1/types.go | 253 + .../v1beta1/types_swagger_doc_generated.go | 124 + .../policy/v1beta1/zz_generated.deepcopy.go | 295 +- .../api/rbac/v1/zz_generated.deepcopy.go | 26 +- .../rbac/v1alpha1/zz_generated.deepcopy.go | 26 +- .../api/rbac/v1beta1/zz_generated.deepcopy.go | 26 +- .../k8s.io/api/scheduling/v1alpha1/types.go | 7 +- .../v1alpha1/types_swagger_doc_generated.go | 6 +- .../v1alpha1/zz_generated.deepcopy.go | 8 +- .../v1alpha1/zz_generated.deepcopy.go | 8 +- .../api/storage/v1/zz_generated.deepcopy.go | 8 +- .../storage/v1alpha1/zz_generated.deepcopy.go | 8 +- .../api/storage/v1beta1/generated.pb.go | 1579 +++- .../k8s.io/api/storage/v1beta1/register.go | 3 + .../k8s.io/api/storage/v1beta1/types.go | 107 + .../v1beta1/types_swagger_doc_generated.go | 63 + .../storage/v1beta1/zz_generated.deepcopy.go | 167 +- .../pkg/apis/cr/v1/zz_generated.deepcopy.go | 8 +- .../clientset/versioned/fake/register.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- .../pkg/apis/apiextensions/fuzzer/fuzzer.go | 26 - .../pkg/apis/apiextensions/types.go | 47 +- .../apiextensions/v1beta1/generated.pb.go | 913 ++- .../pkg/apis/apiextensions/v1beta1/types.go | 50 +- .../v1beta1/zz_generated.conversion.go | 79 +- .../v1beta1/zz_generated.deepcopy.go | 153 +- .../v1beta1/zz_generated.defaults.go | 2 +- .../apiextensions/validation/validation.go | 103 +- .../apiextensions/zz_generated.deepcopy.go | 153 +- .../pkg/apiserver/apiserver.go | 35 +- .../customresource_discovery_controller.go | 22 + .../pkg/apiserver/customresource_handler.go | 427 +- .../pkg/apiserver/validation/validation.go | 29 +- .../client/clientset/clientset/clientset.go | 2 + .../pkg/client/clientset/clientset/doc.go | 2 + .../clientset/fake/clientset_generated.go | 12 +- .../client/clientset/clientset/fake/doc.go | 2 + .../clientset/clientset/fake/register.go | 5 +- .../client/clientset/clientset/scheme/doc.go | 2 + .../clientset/clientset/scheme/register.go | 5 +- .../v1beta1/apiextensions_client.go | 2 + .../v1beta1/customresourcedefinition.go | 2 + .../typed/apiextensions/v1beta1/doc.go | 2 + .../typed/apiextensions/v1beta1/fake/doc.go | 2 + .../v1beta1/fake/fake_apiextensions_client.go | 2 + .../fake/fake_customresourcedefinition.go | 2 + .../v1beta1/generated_expansion.go | 2 + .../clientset/internalclientset/clientset.go | 2 + .../client/clientset/internalclientset/doc.go | 2 + .../fake/clientset_generated.go | 12 +- .../clientset/internalclientset/fake/doc.go | 2 + .../internalclientset/fake/register.go | 5 +- .../clientset/internalclientset/scheme/doc.go | 2 + .../internalclientset/scheme/register.go | 6 +- .../internalversion/apiextensions_client.go | 2 + .../customresourcedefinition.go | 2 + .../apiextensions/internalversion/doc.go | 2 + .../apiextensions/internalversion/fake/doc.go | 2 + .../fake/fake_apiextensions_client.go | 2 + .../fake/fake_customresourcedefinition.go | 2 + .../internalversion/generated_expansion.go | 2 + .../apiextensions/interface.go | 2 +- .../v1beta1/customresourcedefinition.go | 5 +- .../apiextensions/v1beta1/interface.go | 2 +- .../informers/externalversions/factory.go | 9 +- .../informers/externalversions/generic.go | 3 +- .../internalinterfaces/factory_interfaces.go | 5 +- .../apiextensions/interface.go | 2 +- .../customresourcedefinition.go | 5 +- .../internalversion/interface.go | 2 +- .../informers/internalversion/factory.go | 9 +- .../informers/internalversion/generic.go | 3 +- .../internalinterfaces/factory_interfaces.go | 5 +- .../customresourcedefinition.go | 2 +- .../internalversion/expansion_generated.go | 2 +- .../v1beta1/customresourcedefinition.go | 2 +- .../v1beta1/expansion_generated.go | 2 +- .../pkg/cmd/server/start.go | 10 +- .../controller/status/naming_controller.go | 2 + .../pkg/features/kube_features.go | 9 +- .../pkg/registry/customresource/etcd.go | 217 +- .../pkg/registry/customresource/registry.go | 104 + .../customresource/status_strategy.go | 62 + .../pkg/registry/customresource/strategy.go | 187 +- .../tableconvertor/tableconvertor.go | 120 + .../pkg/registry/customresource/validator.go | 241 + .../registry/customresourcedefinition/etcd.go | 2 +- .../customresourcedefinition/strategy.go | 19 +- .../test/integration/testserver/resources.go | 35 + .../test/integration/testserver/start.go | 58 +- .../apimachinery/pkg/api/errors/errors.go | 21 + .../apimachinery/pkg/api/meta/errors.go | 20 +- .../k8s.io/apimachinery/pkg/api/meta/meta.go | 8 +- .../pkg/api/meta/multirestmapper.go | 4 +- .../apimachinery/pkg/api/meta/priority.go | 2 +- .../apimachinery/pkg/api/meta/restmapper.go | 4 +- .../apimachinery/pkg/api/meta/table/table.go | 71 + .../apimachinery/pkg/api/resource/quantity.go | 22 +- .../pkg/api/resource/zz_generated.deepcopy.go | 2 +- .../pkg/api/testing/roundtrip/roundtrip.go | 6 - .../pkg/apimachinery/announced/announced.go | 2 +- .../pkg/apis/meta/fuzzer/fuzzer.go | 6 +- .../pkg/apis/meta/internalversion/doc.go | 1 + .../pkg/apis/meta/internalversion/register.go | 20 +- .../zz_generated.conversion.go | 13 +- .../internalversion/zz_generated.deepcopy.go | 8 +- .../pkg/apis/meta/v1/conversion.go | 18 + .../apimachinery/pkg/apis/meta/v1/labels.go | 28 +- .../pkg/apis/meta/v1/micro_time.go | 22 +- .../apimachinery/pkg/apis/meta/v1/time.go | 22 +- .../apimachinery/pkg/apis/meta/v1/types.go | 13 + .../meta/v1/types_swagger_doc_generated.go | 2 +- .../pkg/apis/meta/v1/unstructured/helpers.go | 218 +- .../apis/meta/v1/unstructured/unstructured.go | 22 +- .../v1/unstructured/zz_generated.deepcopy.go | 8 +- .../pkg/apis/meta/v1/zz_generated.deepcopy.go | 58 +- .../pkg/apis/meta/v1/zz_generated.defaults.go | 2 +- .../meta/{v1alpha1 => v1beta1}/conversion.go | 6 +- .../meta/{v1alpha1 => v1beta1}/deepcopy.go | 2 +- .../apis/meta/{v1alpha1 => v1beta1}/doc.go | 2 +- .../{v1alpha1 => v1beta1}/generated.pb.go | 68 +- .../meta/{v1alpha1 => v1beta1}/register.go | 10 +- .../apis/meta/{v1alpha1 => v1beta1}/types.go | 6 +- .../types_swagger_doc_generated.go | 4 +- .../zz_generated.deepcopy.go | 16 +- .../meta/v1beta1/zz_generated.defaults.go | 32 + .../pkg/apis/testapigroup/v1/generated.pb.go | 138 +- .../pkg/apis/testapigroup/v1/types.go | 2 +- .../v1/types_swagger_doc_generated.go | 17 - .../v1/zz_generated.conversion.go | 5 +- .../testapigroup/v1/zz_generated.deepcopy.go | 12 +- .../testapigroup/v1/zz_generated.defaults.go | 2 +- .../testapigroup/zz_generated.deepcopy.go | 12 +- .../apimachinery/pkg/fields/selector.go | 2 +- .../pkg/labels/zz_generated.deepcopy.go | 2 +- .../k8s.io/apimachinery/pkg/runtime/codec.go | 2 +- .../pkg/runtime/schema/group_version.go | 24 + .../k8s.io/apimachinery/pkg/runtime/scheme.go | 1 + .../pkg/runtime/serializer/json/json.go | 58 +- .../testing/zz_generated.deepcopy.go | 17 +- .../apimachinery/pkg/runtime/testing/types.go | 3 + .../runtime/testing/zz_generated.deepcopy.go | 65 +- .../pkg/runtime/zz_generated.deepcopy.go | 8 +- .../pkg/test/zz_generated.deepcopy.go | 8 +- .../pkg/util/duration/duration.go | 43 + .../apimachinery/pkg/util/errors/errors.go | 2 +- .../apimachinery/pkg/util/intstr/intstr.go | 22 +- .../apimachinery/pkg/util/runtime/runtime.go | 2 +- .../pkg/util/strategicpatch/patch.go | 28 +- .../pkg/util/waitgroup/waitgroup.go | 2 +- .../apimachinery/pkg/util/yaml/decoder.go | 6 +- .../pkg/watch/zz_generated.deepcopy.go | 2 +- .../k8s.io/apiserver/pkg/admission/config.go | 31 +- .../configuration/mutating_webhook_manager.go | 88 +- .../validating_webhook_manager.go | 80 +- .../apiserver/pkg/admission/decorator.go | 39 + .../plugin/namespace/lifecycle/admission.go | 15 +- .../v1alpha1/zz_generated.conversion.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 5 +- .../v1alpha1/zz_generated.defaults.go | 2 +- .../webhookadmission/zz_generated.deepcopy.go | 5 +- .../admission/plugin/webhook/config/client.go | 14 +- .../plugin/webhook/initializer/initializer.go | 2 +- .../plugin/webhook/mutating/admission.go | 48 +- .../admission/plugin/webhook/rules/rules.go | 12 + .../plugin/webhook/validating/admission.go | 50 +- .../k8s.io/apiserver/pkg/admission/plugins.go | 8 +- .../v1alpha1/zz_generated.conversion.go | 5 +- .../v1alpha1/zz_generated.deepcopy.go | 5 +- .../v1alpha1/zz_generated.defaults.go | 2 +- .../apis/apiserver/zz_generated.deepcopy.go | 5 +- .../k8s.io/apiserver/pkg/apis/audit/types.go | 25 +- .../pkg/apis/audit/v1alpha1/generated.pb.go | 317 +- .../pkg/apis/audit/v1alpha1/types.go | 25 +- .../audit/v1alpha1/zz_generated.conversion.go | 7 +- .../audit/v1alpha1/zz_generated.deepcopy.go | 21 +- .../audit/v1alpha1/zz_generated.defaults.go | 2 +- .../pkg/apis/audit/v1beta1/generated.pb.go | 318 +- .../apiserver/pkg/apis/audit/v1beta1/types.go | 27 +- .../audit/v1beta1/zz_generated.conversion.go | 7 +- .../audit/v1beta1/zz_generated.deepcopy.go | 21 +- .../audit/v1beta1/zz_generated.defaults.go | 2 +- .../pkg/apis/audit/zz_generated.deepcopy.go | 47 +- .../apiserver/pkg/apis/example/v1/types.go | 2 +- .../example/v1/zz_generated.conversion.go | 5 +- .../apis/example/v1/zz_generated.deepcopy.go | 12 +- .../apis/example/v1/zz_generated.defaults.go | 2 +- .../pkg/apis/example/zz_generated.deepcopy.go | 15 +- .../v1/types_swagger_doc_generated.go | 17 - .../example2/v1/zz_generated.conversion.go | 2 +- .../apis/example2/v1/zz_generated.deepcopy.go | 5 +- .../apis/example2/v1/zz_generated.defaults.go | 2 +- .../apis/example2/zz_generated.deepcopy.go | 2 +- .../apiserver/pkg/audit/policy/checker.go | 33 +- .../k8s.io/apiserver/pkg/audit/request.go | 49 +- .../k8s.io/apiserver/pkg/audit/union.go | 11 + .../authorization/authorizer/interfaces.go | 2 +- .../pkg/authorization/union/union.go | 2 +- .../apiserver/pkg/endpoints/filters/audit.go | 2 +- .../pkg/endpoints/filters/authentication.go | 5 +- .../pkg/endpoints/filters/authorization.go | 1 + .../pkg/endpoints/handlers/create.go | 2 +- .../pkg/endpoints/handlers/delete.go | 4 +- .../pkg/endpoints/handlers/negotiation/doc.go | 2 +- .../endpoints/handlers/negotiation/errors.go | 4 +- .../handlers/negotiation/negotiate.go | 55 +- .../apiserver/pkg/endpoints/handlers/patch.go | 40 +- .../apiserver/pkg/endpoints/handlers/proxy.go | 285 - .../pkg/endpoints/handlers/response.go | 32 +- .../apiserver/pkg/endpoints/handlers/rest.go | 6 +- .../pkg/endpoints/handlers/update.go | 2 +- .../apiserver/pkg/endpoints/installer.go | 79 +- .../pkg/endpoints/metrics/metrics.go | 41 +- .../openapi/testing/zz_generated.deepcopy.go | 5 +- .../pkg/endpoints/request/context.go | 7 +- .../pkg/endpoints/request/requestinfo.go | 3 +- .../testing/zz_generated.deepcopy.go | 17 +- .../apiserver/pkg/registry/generic/options.go | 3 + .../pkg/registry/generic/registry/store.go | 43 +- .../apiserver/pkg/registry/rest/rest.go | 25 +- .../pkg/registry/rest/resttest/resttest.go | 4 +- .../apiserver/pkg/registry/rest/table.go | 10 +- .../registry/rest/zz_generated.deepcopy.go | 5 +- .../k8s.io/apiserver/pkg/server/config.go | 97 +- .../pkg/server/filters/compression.go | 1 + .../pkg/server/filters/longrunning.go | 6 +- .../apiserver/pkg/server/filters/timeout.go | 4 +- .../apiserver/pkg/server/filters/waitgroup.go | 2 +- .../apiserver/pkg/server/filters/wrap.go | 4 +- .../apiserver/pkg/server/genericapiserver.go | 2 +- .../k8s.io/apiserver/pkg/server/handler.go | 3 +- .../apiserver/pkg/server/options/admission.go | 136 +- .../pkg/server/options/api_enablement.go | 111 + .../apiserver/pkg/server/options/audit.go | 269 +- .../pkg/server/options/authentication.go | 17 +- .../pkg/server/options/authorization.go | 2 +- .../server/options/encryptionconfig/config.go | 21 +- .../options/encryptionconfig/plugins.go | 118 - .../server/options/encryptionconfig/types.go | 4 +- .../apiserver/pkg/server/options/etcd.go | 17 +- .../pkg/server/options/recommended.go | 49 +- .../apiserver/pkg/server/options/serving.go | 130 +- .../server/options/serving_with_loopback.go | 79 + .../pkg/server/resourceconfig}/doc.go | 5 +- .../pkg/server/resourceconfig/helpers.go | 164 + .../server/routes/data/swagger/datafile.go | 6 +- .../apiserver/pkg/server/routes/openapi.go | 9 +- .../k8s.io/apiserver/pkg/server/serve.go | 39 +- .../pkg/server/storage/resource_config.go | 142 +- .../pkg/server/storage/storage_factory.go | 19 +- .../k8s.io/apiserver/pkg/storage/cacher.go | 56 +- .../pkg/storage/etcd/api_object_versioner.go | 39 + .../apiserver/pkg/storage/etcd/etcd_helper.go | 32 +- .../pkg/storage/etcd/etcd_watcher.go | 31 +- .../pkg/storage/etcd/metrics/metrics.go | 12 + .../pkg/storage/etcd/testing/utils.go | 32 +- .../apiserver/pkg/storage/etcd3/store.go | 34 +- .../apiserver/pkg/storage/etcd3/watcher.go | 13 +- .../apiserver/pkg/storage/interfaces.go | 22 +- .../pkg/storage/selection_predicate.go | 2 +- .../pkg/storage/storagebackend/config.go | 3 + .../storage/storagebackend/factory/etcd3.go | 15 +- .../storage/testing/zz_generated.deepcopy.go | 5 +- .../k8s.io/apiserver/pkg/storage/util.go | 46 - .../value/encrypt/envelope/envelope.go | 33 +- .../value/encrypt/envelope/grpc_service.go | 144 + .../encrypt/envelope/v1beta1/service.pb.go | 370 + .../apiserver/pkg/storage/watch_cache.go | 74 +- .../pkg/util/flag/ciphersuites_flag.go | 87 + .../k8s.io/apiserver/pkg/util/flag/noop.go | 41 + .../k8s.io/apiserver/pkg/util/logs/logs.go | 14 +- .../apiserver/pkg/util/webhook/webhook.go | 3 +- .../plugin/pkg/audit/buffered/buffered.go | 283 + .../plugin/pkg/audit/buffered}/doc.go | 9 +- .../apiserver/plugin/pkg/audit/log/backend.go | 13 +- .../plugin/pkg/audit/webhook/webhook.go | 348 +- .../authenticator/password/keystone/doc.go | 20 - .../password/keystone/keystone.go | 94 - .../pkg/authenticator/token/oidc/oidc.go | 314 +- .../token/oidc/testing/provider.go | 200 - .../plugin/pkg/authorizer/webhook/webhook.go | 2 +- .../client-go/discovery/discovery_client.go | 34 +- .../k8s.io/client-go/discovery/restmapper.go | 2 + cmd/vendor/k8s.io/client-go/dynamic/client.go | 55 +- .../k8s.io/client-go/dynamic/fake/client.go | 2 +- .../main.go | 11 +- .../admissionregistration/interface.go | 2 +- .../v1alpha1/initializerconfiguration.go | 5 +- .../v1alpha1/interface.go | 2 +- .../v1beta1/interface.go | 2 +- .../v1beta1/mutatingwebhookconfiguration.go | 5 +- .../v1beta1/validatingwebhookconfiguration.go | 5 +- .../client-go/informers/apps/interface.go | 2 +- .../informers/apps/v1/controllerrevision.go | 5 +- .../client-go/informers/apps/v1/daemonset.go | 5 +- .../client-go/informers/apps/v1/deployment.go | 5 +- .../client-go/informers/apps/v1/interface.go | 2 +- .../client-go/informers/apps/v1/replicaset.go | 5 +- .../informers/apps/v1/statefulset.go | 5 +- .../apps/v1beta1/controllerrevision.go | 5 +- .../informers/apps/v1beta1/deployment.go | 5 +- .../informers/apps/v1beta1/interface.go | 2 +- .../informers/apps/v1beta1/statefulset.go | 5 +- .../apps/v1beta2/controllerrevision.go | 5 +- .../informers/apps/v1beta2/daemonset.go | 5 +- .../informers/apps/v1beta2/deployment.go | 5 +- .../informers/apps/v1beta2/interface.go | 2 +- .../informers/apps/v1beta2/replicaset.go | 5 +- .../informers/apps/v1beta2/statefulset.go | 5 +- .../informers/autoscaling/interface.go | 2 +- .../autoscaling/v1/horizontalpodautoscaler.go | 5 +- .../informers/autoscaling/v1/interface.go | 2 +- .../v2beta1/horizontalpodautoscaler.go | 5 +- .../autoscaling/v2beta1/interface.go | 2 +- .../client-go/informers/batch/interface.go | 2 +- .../client-go/informers/batch/v1/interface.go | 2 +- .../client-go/informers/batch/v1/job.go | 5 +- .../informers/batch/v1beta1/cronjob.go | 5 +- .../informers/batch/v1beta1/interface.go | 2 +- .../informers/batch/v2alpha1/cronjob.go | 5 +- .../informers/batch/v2alpha1/interface.go | 2 +- .../informers/certificates/interface.go | 2 +- .../v1beta1/certificatesigningrequest.go | 5 +- .../certificates/v1beta1/interface.go | 2 +- .../client-go/informers/core/interface.go | 2 +- .../informers/core/v1/componentstatus.go | 5 +- .../client-go/informers/core/v1/configmap.go | 5 +- .../client-go/informers/core/v1/endpoints.go | 5 +- .../client-go/informers/core/v1/event.go | 5 +- .../client-go/informers/core/v1/interface.go | 2 +- .../client-go/informers/core/v1/limitrange.go | 5 +- .../client-go/informers/core/v1/namespace.go | 5 +- .../client-go/informers/core/v1/node.go | 5 +- .../informers/core/v1/persistentvolume.go | 5 +- .../core/v1/persistentvolumeclaim.go | 5 +- .../k8s.io/client-go/informers/core/v1/pod.go | 5 +- .../informers/core/v1/podtemplate.go | 5 +- .../core/v1/replicationcontroller.go | 5 +- .../informers/core/v1/resourcequota.go | 5 +- .../client-go/informers/core/v1/secret.go | 5 +- .../client-go/informers/core/v1/service.go | 5 +- .../informers/core/v1/serviceaccount.go | 5 +- .../client-go/informers/events/interface.go | 2 +- .../informers/events/v1beta1/event.go | 5 +- .../informers/events/v1beta1/interface.go | 2 +- .../informers/extensions/interface.go | 2 +- .../informers/extensions/v1beta1/daemonset.go | 5 +- .../extensions/v1beta1/deployment.go | 5 +- .../informers/extensions/v1beta1/ingress.go | 5 +- .../informers/extensions/v1beta1/interface.go | 2 +- .../extensions/v1beta1/podsecuritypolicy.go | 5 +- .../extensions/v1beta1/replicaset.go | 5 +- .../k8s.io/client-go/informers/factory.go | 9 +- .../k8s.io/client-go/informers/generic.go | 7 +- .../internalinterfaces/factory_interfaces.go | 5 +- .../informers/networking/interface.go | 2 +- .../informers/networking/v1/interface.go | 2 +- .../informers/networking/v1/networkpolicy.go | 5 +- .../client-go/informers/policy/interface.go | 2 +- .../informers/policy/v1beta1/interface.go | 9 +- .../policy/v1beta1/poddisruptionbudget.go | 5 +- .../policy/v1beta1/podsecuritypolicy.go | 88 + .../client-go/informers/rbac/interface.go | 2 +- .../informers/rbac/v1/clusterrole.go | 5 +- .../informers/rbac/v1/clusterrolebinding.go | 5 +- .../client-go/informers/rbac/v1/interface.go | 2 +- .../client-go/informers/rbac/v1/role.go | 5 +- .../informers/rbac/v1/rolebinding.go | 5 +- .../informers/rbac/v1alpha1/clusterrole.go | 5 +- .../rbac/v1alpha1/clusterrolebinding.go | 5 +- .../informers/rbac/v1alpha1/interface.go | 2 +- .../client-go/informers/rbac/v1alpha1/role.go | 5 +- .../informers/rbac/v1alpha1/rolebinding.go | 5 +- .../informers/rbac/v1beta1/clusterrole.go | 5 +- .../rbac/v1beta1/clusterrolebinding.go | 5 +- .../informers/rbac/v1beta1/interface.go | 2 +- .../client-go/informers/rbac/v1beta1/role.go | 5 +- .../informers/rbac/v1beta1/rolebinding.go | 5 +- .../informers/scheduling/interface.go | 2 +- .../scheduling/v1alpha1/interface.go | 2 +- .../scheduling/v1alpha1/priorityclass.go | 5 +- .../client-go/informers/settings/interface.go | 2 +- .../informers/settings/v1alpha1/interface.go | 2 +- .../informers/settings/v1alpha1/podpreset.go | 5 +- .../client-go/informers/storage/interface.go | 2 +- .../informers/storage/v1/interface.go | 2 +- .../informers/storage/v1/storageclass.go | 5 +- .../informers/storage/v1alpha1/interface.go | 2 +- .../storage/v1alpha1/volumeattachment.go | 5 +- .../informers/storage/v1beta1/interface.go | 9 +- .../informers/storage/v1beta1/storageclass.go | 5 +- .../storage/v1beta1/volumeattachment.go | 88 + .../k8s.io/client-go/kubernetes/clientset.go | 2 + cmd/vendor/k8s.io/client-go/kubernetes/doc.go | 2 + .../kubernetes/fake/clientset_generated.go | 12 +- .../k8s.io/client-go/kubernetes/fake/doc.go | 2 + .../client-go/kubernetes/fake/register.go | 5 +- .../k8s.io/client-go/kubernetes/scheme/doc.go | 2 + .../client-go/kubernetes/scheme/register.go | 5 +- .../v1alpha1/admissionregistration_client.go | 2 + .../admissionregistration/v1alpha1/doc.go | 2 + .../v1alpha1/fake/doc.go | 2 + .../fake/fake_admissionregistration_client.go | 2 + .../fake/fake_initializerconfiguration.go | 2 + .../v1alpha1/generated_expansion.go | 2 + .../v1alpha1/initializerconfiguration.go | 2 + .../v1beta1/admissionregistration_client.go | 2 + .../admissionregistration/v1beta1/doc.go | 2 + .../admissionregistration/v1beta1/fake/doc.go | 2 + .../fake/fake_admissionregistration_client.go | 2 + .../fake/fake_mutatingwebhookconfiguration.go | 2 + .../fake_validatingwebhookconfiguration.go | 2 + .../v1beta1/generated_expansion.go | 2 + .../v1beta1/mutatingwebhookconfiguration.go | 2 + .../v1beta1/validatingwebhookconfiguration.go | 2 + .../kubernetes/typed/apps/v1/apps_client.go | 2 + .../typed/apps/v1/controllerrevision.go | 2 + .../kubernetes/typed/apps/v1/daemonset.go | 2 + .../kubernetes/typed/apps/v1/deployment.go | 2 + .../client-go/kubernetes/typed/apps/v1/doc.go | 2 + .../kubernetes/typed/apps/v1/fake/doc.go | 2 + .../typed/apps/v1/fake/fake_apps_client.go | 2 + .../apps/v1/fake/fake_controllerrevision.go | 2 + .../typed/apps/v1/fake/fake_daemonset.go | 2 + .../typed/apps/v1/fake/fake_deployment.go | 2 + .../typed/apps/v1/fake/fake_replicaset.go | 2 + .../typed/apps/v1/fake/fake_statefulset.go | 2 + .../typed/apps/v1/generated_expansion.go | 2 + .../kubernetes/typed/apps/v1/replicaset.go | 2 + .../kubernetes/typed/apps/v1/statefulset.go | 2 + .../typed/apps/v1beta1/apps_client.go | 2 + .../typed/apps/v1beta1/controllerrevision.go | 2 + .../typed/apps/v1beta1/deployment.go | 2 + .../kubernetes/typed/apps/v1beta1/doc.go | 2 + .../kubernetes/typed/apps/v1beta1/fake/doc.go | 2 + .../apps/v1beta1/fake/fake_apps_client.go | 2 + .../v1beta1/fake/fake_controllerrevision.go | 2 + .../apps/v1beta1/fake/fake_deployment.go | 2 + .../typed/apps/v1beta1/fake/fake_scale.go | 2 + .../apps/v1beta1/fake/fake_statefulset.go | 2 + .../typed/apps/v1beta1/generated_expansion.go | 2 + .../kubernetes/typed/apps/v1beta1/scale.go | 2 + .../typed/apps/v1beta1/statefulset.go | 2 + .../typed/apps/v1beta2/apps_client.go | 2 + .../typed/apps/v1beta2/controllerrevision.go | 2 + .../typed/apps/v1beta2/daemonset.go | 2 + .../typed/apps/v1beta2/deployment.go | 2 + .../kubernetes/typed/apps/v1beta2/doc.go | 2 + .../kubernetes/typed/apps/v1beta2/fake/doc.go | 2 + .../apps/v1beta2/fake/fake_apps_client.go | 2 + .../v1beta2/fake/fake_controllerrevision.go | 2 + .../typed/apps/v1beta2/fake/fake_daemonset.go | 2 + .../apps/v1beta2/fake/fake_deployment.go | 2 + .../apps/v1beta2/fake/fake_replicaset.go | 2 + .../typed/apps/v1beta2/fake/fake_scale.go | 2 + .../apps/v1beta2/fake/fake_statefulset.go | 2 + .../typed/apps/v1beta2/generated_expansion.go | 2 + .../typed/apps/v1beta2/replicaset.go | 2 + .../kubernetes/typed/apps/v1beta2/scale.go | 2 + .../typed/apps/v1beta2/statefulset.go | 2 + .../v1/authentication_client.go | 2 + .../kubernetes/typed/authentication/v1/doc.go | 2 + .../typed/authentication/v1/fake/doc.go | 2 + .../v1/fake/fake_authentication_client.go | 2 + .../v1/fake/fake_tokenreview.go | 2 + .../authentication/v1/generated_expansion.go | 2 + .../typed/authentication/v1/tokenreview.go | 2 + .../v1beta1/authentication_client.go | 2 + .../typed/authentication/v1beta1/doc.go | 2 + .../typed/authentication/v1beta1/fake/doc.go | 2 + .../fake/fake_authentication_client.go | 2 + .../v1beta1/fake/fake_tokenreview.go | 2 + .../v1beta1/generated_expansion.go | 2 + .../authentication/v1beta1/tokenreview.go | 2 + .../authorization/v1/authorization_client.go | 2 + .../kubernetes/typed/authorization/v1/doc.go | 2 + .../typed/authorization/v1/fake/doc.go | 2 + .../v1/fake/fake_authorization_client.go | 2 + .../v1/fake/fake_localsubjectaccessreview.go | 2 + .../v1/fake/fake_selfsubjectaccessreview.go | 2 + .../v1/fake/fake_selfsubjectrulesreview.go | 2 + .../v1/fake/fake_subjectaccessreview.go | 2 + .../authorization/v1/generated_expansion.go | 2 + .../v1/localsubjectaccessreview.go | 2 + .../v1/selfsubjectaccessreview.go | 2 + .../v1/selfsubjectrulesreview.go | 2 + .../authorization/v1/subjectaccessreview.go | 2 + .../v1beta1/authorization_client.go | 2 + .../typed/authorization/v1beta1/doc.go | 2 + .../typed/authorization/v1beta1/fake/doc.go | 2 + .../v1beta1/fake/fake_authorization_client.go | 2 + .../fake/fake_localsubjectaccessreview.go | 2 + .../fake/fake_selfsubjectaccessreview.go | 2 + .../fake/fake_selfsubjectrulesreview.go | 2 + .../v1beta1/fake/fake_subjectaccessreview.go | 2 + .../v1beta1/generated_expansion.go | 2 + .../v1beta1/localsubjectaccessreview.go | 2 + .../v1beta1/selfsubjectaccessreview.go | 2 + .../v1beta1/selfsubjectrulesreview.go | 2 + .../v1beta1/subjectaccessreview.go | 2 + .../autoscaling/v1/autoscaling_client.go | 2 + .../kubernetes/typed/autoscaling/v1/doc.go | 2 + .../typed/autoscaling/v1/fake/doc.go | 2 + .../v1/fake/fake_autoscaling_client.go | 2 + .../v1/fake/fake_horizontalpodautoscaler.go | 2 + .../autoscaling/v1/generated_expansion.go | 2 + .../autoscaling/v1/horizontalpodautoscaler.go | 2 + .../autoscaling/v2beta1/autoscaling_client.go | 2 + .../typed/autoscaling/v2beta1/doc.go | 2 + .../typed/autoscaling/v2beta1/fake/doc.go | 2 + .../v2beta1/fake/fake_autoscaling_client.go | 2 + .../fake/fake_horizontalpodautoscaler.go | 2 + .../v2beta1/generated_expansion.go | 2 + .../v2beta1/horizontalpodautoscaler.go | 2 + .../kubernetes/typed/batch/v1/batch_client.go | 2 + .../kubernetes/typed/batch/v1/doc.go | 2 + .../kubernetes/typed/batch/v1/fake/doc.go | 2 + .../typed/batch/v1/fake/fake_batch_client.go | 2 + .../typed/batch/v1/fake/fake_job.go | 2 + .../typed/batch/v1/generated_expansion.go | 2 + .../kubernetes/typed/batch/v1/job.go | 2 + .../typed/batch/v1beta1/batch_client.go | 2 + .../kubernetes/typed/batch/v1beta1/cronjob.go | 2 + .../kubernetes/typed/batch/v1beta1/doc.go | 2 + .../typed/batch/v1beta1/fake/doc.go | 2 + .../batch/v1beta1/fake/fake_batch_client.go | 2 + .../typed/batch/v1beta1/fake/fake_cronjob.go | 2 + .../batch/v1beta1/generated_expansion.go | 2 + .../typed/batch/v2alpha1/batch_client.go | 2 + .../typed/batch/v2alpha1/cronjob.go | 2 + .../kubernetes/typed/batch/v2alpha1/doc.go | 2 + .../typed/batch/v2alpha1/fake/doc.go | 2 + .../batch/v2alpha1/fake/fake_batch_client.go | 2 + .../typed/batch/v2alpha1/fake/fake_cronjob.go | 2 + .../batch/v2alpha1/generated_expansion.go | 2 + .../v1beta1/certificates_client.go | 2 + .../v1beta1/certificatesigningrequest.go | 2 + .../typed/certificates/v1beta1/doc.go | 2 + .../typed/certificates/v1beta1/fake/doc.go | 2 + .../v1beta1/fake/fake_certificates_client.go | 2 + .../fake/fake_certificatesigningrequest.go | 2 + .../v1beta1/generated_expansion.go | 2 + .../typed/core/v1/componentstatus.go | 2 + .../kubernetes/typed/core/v1/configmap.go | 2 + .../kubernetes/typed/core/v1/core_client.go | 2 + .../client-go/kubernetes/typed/core/v1/doc.go | 2 + .../kubernetes/typed/core/v1/endpoints.go | 2 + .../kubernetes/typed/core/v1/event.go | 2 + .../kubernetes/typed/core/v1/fake/doc.go | 2 + .../core/v1/fake/fake_componentstatus.go | 2 + .../typed/core/v1/fake/fake_configmap.go | 2 + .../typed/core/v1/fake/fake_core_client.go | 2 + .../typed/core/v1/fake/fake_endpoints.go | 2 + .../typed/core/v1/fake/fake_event.go | 2 + .../typed/core/v1/fake/fake_limitrange.go | 2 + .../typed/core/v1/fake/fake_namespace.go | 2 + .../typed/core/v1/fake/fake_node.go | 2 + .../core/v1/fake/fake_persistentvolume.go | 2 + .../v1/fake/fake_persistentvolumeclaim.go | 2 + .../kubernetes/typed/core/v1/fake/fake_pod.go | 2 + .../typed/core/v1/fake/fake_podtemplate.go | 2 + .../v1/fake/fake_replicationcontroller.go | 2 + .../typed/core/v1/fake/fake_resourcequota.go | 2 + .../typed/core/v1/fake/fake_secret.go | 2 + .../typed/core/v1/fake/fake_service.go | 2 + .../typed/core/v1/fake/fake_serviceaccount.go | 2 + .../v1/fake/fake_serviceaccount_expansion.go | 31 + .../typed/core/v1/generated_expansion.go | 4 +- .../kubernetes/typed/core/v1/limitrange.go | 2 + .../kubernetes/typed/core/v1/namespace.go | 2 + .../kubernetes/typed/core/v1/node.go | 2 + .../typed/core/v1/persistentvolume.go | 2 + .../typed/core/v1/persistentvolumeclaim.go | 2 + .../client-go/kubernetes/typed/core/v1/pod.go | 2 + .../kubernetes/typed/core/v1/podtemplate.go | 2 + .../typed/core/v1/replicationcontroller.go | 2 + .../kubernetes/typed/core/v1/resourcequota.go | 2 + .../kubernetes/typed/core/v1/secret.go | 2 + .../kubernetes/typed/core/v1/service.go | 2 + .../typed/core/v1/serviceaccount.go | 2 + .../typed/core/v1/serviceaccount_expansion.go | 41 + .../kubernetes/typed/events/v1beta1/doc.go | 2 + .../kubernetes/typed/events/v1beta1/event.go | 2 + .../typed/events/v1beta1/events_client.go | 2 + .../typed/events/v1beta1/fake/doc.go | 2 + .../typed/events/v1beta1/fake/fake_event.go | 2 + .../events/v1beta1/fake/fake_events_client.go | 2 + .../events/v1beta1/generated_expansion.go | 2 + .../typed/extensions/v1beta1/daemonset.go | 2 + .../typed/extensions/v1beta1/deployment.go | 2 + .../typed/extensions/v1beta1/doc.go | 2 + .../extensions/v1beta1/extensions_client.go | 2 + .../typed/extensions/v1beta1/fake/doc.go | 2 + .../extensions/v1beta1/fake/fake_daemonset.go | 2 + .../v1beta1/fake/fake_deployment.go | 2 + .../v1beta1/fake/fake_extensions_client.go | 2 + .../extensions/v1beta1/fake/fake_ingress.go | 2 + .../v1beta1/fake/fake_podsecuritypolicy.go | 2 + .../v1beta1/fake/fake_replicaset.go | 2 + .../extensions/v1beta1/fake/fake_scale.go | 2 + .../extensions/v1beta1/generated_expansion.go | 2 + .../typed/extensions/v1beta1/ingress.go | 2 + .../extensions/v1beta1/podsecuritypolicy.go | 2 + .../typed/extensions/v1beta1/replicaset.go | 2 + .../typed/extensions/v1beta1/scale.go | 2 + .../kubernetes/typed/networking/v1/doc.go | 2 + .../typed/networking/v1/fake/doc.go | 2 + .../v1/fake/fake_networking_client.go | 2 + .../networking/v1/fake/fake_networkpolicy.go | 2 + .../networking/v1/generated_expansion.go | 2 + .../typed/networking/v1/networking_client.go | 2 + .../typed/networking/v1/networkpolicy.go | 2 + .../kubernetes/typed/policy/v1beta1/doc.go | 2 + .../typed/policy/v1beta1/eviction.go | 2 + .../typed/policy/v1beta1/fake/doc.go | 2 + .../policy/v1beta1/fake/fake_eviction.go | 2 + .../v1beta1/fake/fake_poddisruptionbudget.go | 2 + .../v1beta1/fake/fake_podsecuritypolicy.go | 120 + .../policy/v1beta1/fake/fake_policy_client.go | 6 + .../policy/v1beta1/generated_expansion.go | 4 + .../policy/v1beta1/poddisruptionbudget.go | 2 + .../typed/policy/v1beta1/podsecuritypolicy.go | 147 + .../typed/policy/v1beta1/policy_client.go | 7 + .../kubernetes/typed/rbac/v1/clusterrole.go | 2 + .../typed/rbac/v1/clusterrolebinding.go | 2 + .../client-go/kubernetes/typed/rbac/v1/doc.go | 2 + .../kubernetes/typed/rbac/v1/fake/doc.go | 2 + .../typed/rbac/v1/fake/fake_clusterrole.go | 2 + .../rbac/v1/fake/fake_clusterrolebinding.go | 2 + .../typed/rbac/v1/fake/fake_rbac_client.go | 2 + .../typed/rbac/v1/fake/fake_role.go | 2 + .../typed/rbac/v1/fake/fake_rolebinding.go | 2 + .../typed/rbac/v1/generated_expansion.go | 2 + .../kubernetes/typed/rbac/v1/rbac_client.go | 2 + .../kubernetes/typed/rbac/v1/role.go | 2 + .../kubernetes/typed/rbac/v1/rolebinding.go | 2 + .../typed/rbac/v1alpha1/clusterrole.go | 2 + .../typed/rbac/v1alpha1/clusterrolebinding.go | 2 + .../kubernetes/typed/rbac/v1alpha1/doc.go | 2 + .../typed/rbac/v1alpha1/fake/doc.go | 2 + .../rbac/v1alpha1/fake/fake_clusterrole.go | 2 + .../v1alpha1/fake/fake_clusterrolebinding.go | 2 + .../rbac/v1alpha1/fake/fake_rbac_client.go | 2 + .../typed/rbac/v1alpha1/fake/fake_role.go | 2 + .../rbac/v1alpha1/fake/fake_rolebinding.go | 2 + .../rbac/v1alpha1/generated_expansion.go | 2 + .../typed/rbac/v1alpha1/rbac_client.go | 2 + .../kubernetes/typed/rbac/v1alpha1/role.go | 2 + .../typed/rbac/v1alpha1/rolebinding.go | 2 + .../typed/rbac/v1beta1/clusterrole.go | 2 + .../typed/rbac/v1beta1/clusterrolebinding.go | 2 + .../kubernetes/typed/rbac/v1beta1/doc.go | 2 + .../kubernetes/typed/rbac/v1beta1/fake/doc.go | 2 + .../rbac/v1beta1/fake/fake_clusterrole.go | 2 + .../v1beta1/fake/fake_clusterrolebinding.go | 2 + .../rbac/v1beta1/fake/fake_rbac_client.go | 2 + .../typed/rbac/v1beta1/fake/fake_role.go | 2 + .../rbac/v1beta1/fake/fake_rolebinding.go | 2 + .../typed/rbac/v1beta1/generated_expansion.go | 2 + .../typed/rbac/v1beta1/rbac_client.go | 2 + .../kubernetes/typed/rbac/v1beta1/role.go | 2 + .../typed/rbac/v1beta1/rolebinding.go | 2 + .../typed/scheduling/v1alpha1/doc.go | 2 + .../typed/scheduling/v1alpha1/fake/doc.go | 2 + .../v1alpha1/fake/fake_priorityclass.go | 2 + .../v1alpha1/fake/fake_scheduling_client.go | 2 + .../v1alpha1/generated_expansion.go | 2 + .../scheduling/v1alpha1/priorityclass.go | 2 + .../scheduling/v1alpha1/scheduling_client.go | 2 + .../kubernetes/typed/settings/v1alpha1/doc.go | 2 + .../typed/settings/v1alpha1/fake/doc.go | 2 + .../settings/v1alpha1/fake/fake_podpreset.go | 2 + .../v1alpha1/fake/fake_settings_client.go | 2 + .../settings/v1alpha1/generated_expansion.go | 2 + .../typed/settings/v1alpha1/podpreset.go | 2 + .../settings/v1alpha1/settings_client.go | 2 + .../kubernetes/typed/storage/v1/doc.go | 2 + .../kubernetes/typed/storage/v1/fake/doc.go | 2 + .../storage/v1/fake/fake_storage_client.go | 2 + .../storage/v1/fake/fake_storageclass.go | 2 + .../typed/storage/v1/generated_expansion.go | 2 + .../typed/storage/v1/storage_client.go | 2 + .../typed/storage/v1/storageclass.go | 2 + .../kubernetes/typed/storage/v1alpha1/doc.go | 2 + .../typed/storage/v1alpha1/fake/doc.go | 2 + .../v1alpha1/fake/fake_storage_client.go | 2 + .../v1alpha1/fake/fake_volumeattachment.go | 2 + .../storage/v1alpha1/generated_expansion.go | 2 + .../typed/storage/v1alpha1/storage_client.go | 2 + .../storage/v1alpha1/volumeattachment.go | 2 + .../kubernetes/typed/storage/v1beta1/doc.go | 2 + .../typed/storage/v1beta1/fake/doc.go | 2 + .../v1beta1/fake/fake_storage_client.go | 6 + .../storage/v1beta1/fake/fake_storageclass.go | 2 + .../v1beta1/fake/fake_volumeattachment.go | 131 + .../storage/v1beta1/generated_expansion.go | 4 + .../typed/storage/v1beta1/storage_client.go | 7 + .../typed/storage/v1beta1/storageclass.go | 2 + .../typed/storage/v1beta1/volumeattachment.go | 163 + .../v1alpha1/expansion_generated.go | 2 +- .../v1alpha1/initializerconfiguration.go | 2 +- .../v1beta1/expansion_generated.go | 2 +- .../v1beta1/mutatingwebhookconfiguration.go | 2 +- .../v1beta1/validatingwebhookconfiguration.go | 2 +- .../listers/apps/v1/controllerrevision.go | 2 +- .../client-go/listers/apps/v1/daemonset.go | 2 +- .../client-go/listers/apps/v1/deployment.go | 2 +- .../listers/apps/v1/expansion_generated.go | 2 +- .../client-go/listers/apps/v1/replicaset.go | 2 +- .../client-go/listers/apps/v1/statefulset.go | 2 +- .../apps/v1beta1/controllerrevision.go | 2 +- .../listers/apps/v1beta1/deployment.go | 2 +- .../apps/v1beta1/expansion_generated.go | 2 +- .../client-go/listers/apps/v1beta1/scale.go | 2 +- .../listers/apps/v1beta1/statefulset.go | 2 +- .../apps/v1beta2/controllerrevision.go | 2 +- .../listers/apps/v1beta2/daemonset.go | 2 +- .../listers/apps/v1beta2/deployment.go | 2 +- .../apps/v1beta2/expansion_generated.go | 2 +- .../listers/apps/v1beta2/replicaset.go | 2 +- .../client-go/listers/apps/v1beta2/scale.go | 2 +- .../listers/apps/v1beta2/statefulset.go | 2 +- .../authentication/v1/expansion_generated.go | 2 +- .../listers/authentication/v1/tokenreview.go | 2 +- .../v1beta1/expansion_generated.go | 2 +- .../authentication/v1beta1/tokenreview.go | 2 +- .../authorization/v1/expansion_generated.go | 2 +- .../v1/localsubjectaccessreview.go | 2 +- .../v1/selfsubjectaccessreview.go | 2 +- .../v1/selfsubjectrulesreview.go | 2 +- .../authorization/v1/subjectaccessreview.go | 2 +- .../v1beta1/expansion_generated.go | 2 +- .../v1beta1/localsubjectaccessreview.go | 2 +- .../v1beta1/selfsubjectaccessreview.go | 2 +- .../v1beta1/selfsubjectrulesreview.go | 2 +- .../v1beta1/subjectaccessreview.go | 2 +- .../autoscaling/v1/expansion_generated.go | 2 +- .../autoscaling/v1/horizontalpodautoscaler.go | 2 +- .../v2beta1/expansion_generated.go | 2 +- .../v2beta1/horizontalpodautoscaler.go | 2 +- .../listers/batch/v1/expansion_generated.go | 2 +- .../k8s.io/client-go/listers/batch/v1/job.go | 2 +- .../listers/batch/v1beta1/cronjob.go | 2 +- .../batch/v1beta1/expansion_generated.go | 2 +- .../listers/batch/v2alpha1/cronjob.go | 2 +- .../batch/v2alpha1/expansion_generated.go | 2 +- .../v1beta1/certificatesigningrequest.go | 2 +- .../v1beta1/expansion_generated.go | 2 +- .../listers/core/v1/componentstatus.go | 2 +- .../client-go/listers/core/v1/configmap.go | 2 +- .../client-go/listers/core/v1/endpoints.go | 2 +- .../k8s.io/client-go/listers/core/v1/event.go | 2 +- .../listers/core/v1/expansion_generated.go | 2 +- .../client-go/listers/core/v1/limitrange.go | 2 +- .../client-go/listers/core/v1/namespace.go | 2 +- .../k8s.io/client-go/listers/core/v1/node.go | 2 +- .../listers/core/v1/persistentvolume.go | 2 +- .../listers/core/v1/persistentvolumeclaim.go | 2 +- .../k8s.io/client-go/listers/core/v1/pod.go | 2 +- .../client-go/listers/core/v1/podtemplate.go | 2 +- .../listers/core/v1/replicationcontroller.go | 2 +- .../listers/core/v1/resourcequota.go | 2 +- .../client-go/listers/core/v1/secret.go | 2 +- .../client-go/listers/core/v1/service.go | 2 +- .../listers/core/v1/serviceaccount.go | 2 +- .../client-go/listers/events/v1beta1/event.go | 2 +- .../events/v1beta1/expansion_generated.go | 2 +- .../listers/extensions/v1beta1/daemonset.go | 2 +- .../listers/extensions/v1beta1/deployment.go | 2 +- .../extensions/v1beta1/expansion_generated.go | 2 +- .../listers/extensions/v1beta1/ingress.go | 2 +- .../extensions/v1beta1/podsecuritypolicy.go | 2 +- .../listers/extensions/v1beta1/replicaset.go | 2 +- .../listers/extensions/v1beta1/scale.go | 2 +- .../v1alpha1/expansion_generated.go | 2 +- .../imagepolicy/v1alpha1/imagereview.go | 2 +- .../networking/v1/expansion_generated.go | 2 +- .../listers/networking/v1/networkpolicy.go | 2 +- .../listers/policy/v1beta1/eviction.go | 2 +- .../policy/v1beta1/expansion_generated.go | 6 +- .../policy/v1beta1/poddisruptionbudget.go | 2 +- .../policy/v1beta1/podsecuritypolicy.go | 65 + .../client-go/listers/rbac/v1/clusterrole.go | 2 +- .../listers/rbac/v1/clusterrolebinding.go | 2 +- .../listers/rbac/v1/expansion_generated.go | 2 +- .../k8s.io/client-go/listers/rbac/v1/role.go | 2 +- .../client-go/listers/rbac/v1/rolebinding.go | 2 +- .../listers/rbac/v1alpha1/clusterrole.go | 2 +- .../rbac/v1alpha1/clusterrolebinding.go | 2 +- .../rbac/v1alpha1/expansion_generated.go | 2 +- .../client-go/listers/rbac/v1alpha1/role.go | 2 +- .../listers/rbac/v1alpha1/rolebinding.go | 2 +- .../listers/rbac/v1beta1/clusterrole.go | 2 +- .../rbac/v1beta1/clusterrolebinding.go | 2 +- .../rbac/v1beta1/expansion_generated.go | 2 +- .../client-go/listers/rbac/v1beta1/role.go | 2 +- .../listers/rbac/v1beta1/rolebinding.go | 2 +- .../v1alpha1/expansion_generated.go | 2 +- .../scheduling/v1alpha1/priorityclass.go | 2 +- .../settings/v1alpha1/expansion_generated.go | 2 +- .../listers/settings/v1alpha1/podpreset.go | 2 +- .../listers/storage/v1/expansion_generated.go | 2 +- .../listers/storage/v1/storageclass.go | 2 +- .../storage/v1alpha1/expansion_generated.go | 2 +- .../storage/v1alpha1/volumeattachment.go | 2 +- .../storage/v1beta1/expansion_generated.go | 6 +- .../listers/storage/v1beta1/storageclass.go | 2 +- .../storage/v1beta1/volumeattachment.go | 65 + .../pkg/apis/clientauthentication}/doc.go | 8 +- .../clientauthentication/install/install.go | 43 + .../pkg/apis/clientauthentication/register.go | 50 + .../pkg/apis/clientauthentication/types.go | 70 + .../clientauthentication/v1alpha1/doc.go} | 16 +- .../clientauthentication/v1alpha1/register.go | 55 + .../clientauthentication/v1alpha1/types.go | 70 + .../v1alpha1/zz_generated.conversion.go | 141 + .../v1alpha1/zz_generated.deepcopy.go | 137 + .../v1alpha1/zz_generated.defaults.go | 2 +- .../zz_generated.deepcopy.go | 137 + .../token/oidc/testing/provider.go | 200 - .../plugin/pkg/client/auth/exec/exec.go | 280 + .../plugin/pkg/client/auth/gcp/gcp.go | 75 +- cmd/vendor/k8s.io/client-go/rest/client.go | 4 +- cmd/vendor/k8s.io/client-go/rest/config.go | 14 +- cmd/vendor/k8s.io/client-go/rest/fake/fake.go | 2 +- cmd/vendor/k8s.io/client-go/rest/request.go | 3 +- cmd/vendor/k8s.io/client-go/rest/transport.go | 16 +- cmd/vendor/k8s.io/client-go/rest/versions.go | 88 - .../client-go/rest/zz_generated.deepcopy.go | 2 +- cmd/vendor/k8s.io/client-go/scale/client.go | 48 +- .../client-go/scale/scheme/appsint/doc.go | 2 +- .../appsv1beta1/zz_generated.conversion.go | 2 +- .../appsv1beta2/zz_generated.conversion.go | 2 +- .../autoscalingv1/zz_generated.conversion.go | 2 +- .../scale/scheme/extensionsint/doc.go | 2 +- .../zz_generated.conversion.go | 2 +- .../scale/scheme/zz_generated.deepcopy.go | 5 +- cmd/vendor/k8s.io/client-go/scale/util.go | 19 + .../k8s.io/client-go/testing/fixture.go | 60 +- .../k8s.io/client-go/tools/auth/clientauth.go | 2 +- .../tools/bootstrap/token/api/doc.go} | 18 +- .../tools/bootstrap/token/api/types.go | 100 + .../tools/bootstrap/token/util/helpers.go | 52 + .../client-go/tools/cache/controller.go | 4 +- .../client-go/tools/cache/delta_fifo.go | 84 +- .../k8s.io/client-go/tools/cache/fifo.go | 2 +- .../k8s.io/client-go/tools/cache/listwatch.go | 14 +- .../k8s.io/client-go/tools/cache/reflector.go | 10 +- .../client-go/tools/cache/shared_informer.go | 59 +- .../client-go/tools/clientcmd/api/types.go | 32 + .../client-go/tools/clientcmd/api/v1/types.go | 32 + .../clientcmd/api/v1/zz_generated.deepcopy.go | 56 +- .../clientcmd/api/zz_generated.deepcopy.go | 56 +- .../tools/clientcmd/client_config.go | 12 +- .../client-go/tools/clientcmd/loader.go | 11 +- .../client-go/tools/clientcmd/validation.go | 23 + .../tools/leaderelection/leaderelection.go | 4 +- .../resourcelock/configmaplock.go | 12 +- .../tools/portforward/portforward.go | 4 +- .../k8s.io/client-go/transport/cache.go | 33 +- .../k8s.io/client-go/transport/config.go | 4 - .../client-go/transport/round_trippers.go | 31 - cmd/vendor/k8s.io/client-go/util/cert/cert.go | 42 +- .../util/certificate/certificate_manager.go | 89 +- .../client-go/util/flowcontrol/throttle.go | 55 +- .../util/workqueue/default_rate_limiters.go | 8 +- .../util/workqueue/delaying_queue.go | 2 +- cmd/vendor/k8s.io/gengo/args/args.go | 25 +- .../deepcopy-gen/generators/deepcopy.go | 414 +- .../deepcopy-gen/output_tests/aliases/doc.go | 89 + .../output_tests/aliases/zz_generated.go | 433 ++ .../output_tests/builtins/zz_generated.go | 2 +- .../output_tests/interfaces/zz_generated.go | 2 +- .../output_tests/maps/zz_generated.go | 2 +- .../output_tests/pointer/zz_generated.go | 2 +- .../output_tests/slices/zz_generated.go | 2 +- .../output_tests/structs/zz_generated.go | 2 +- .../output_tests/wholepkg/zz_generated.go | 33 +- .../_output_tests/empty/zz_generated.go | 2 +- .../_output_tests/pointer/zz_generated.go | 2 +- .../_output_tests/slices/zz_generated.go | 2 +- .../_output_tests/wholepkg/zz_generated.go | 2 +- .../defaulter-gen/generators/defaulter.go | 5 - .../gengo/examples/set-gen/generators/sets.go | 6 +- .../gengo/examples/set-gen/sets/byte.go | 2 +- .../k8s.io/gengo/examples/set-gen/sets/doc.go | 2 +- .../gengo/examples/set-gen/sets/empty.go | 2 +- .../k8s.io/gengo/examples/set-gen/sets/int.go | 2 +- .../gengo/examples/set-gen/sets/int64.go | 2 +- .../gengo/examples/set-gen/sets/string.go | 2 +- cmd/vendor/k8s.io/kube-openapi/LICENSE | 202 - .../kube-openapi/example/openapi-gen/main.go | 47 - .../kube-openapi/pkg/aggregator/aggregator.go | 364 - .../kube-openapi/pkg/builder/openapi.go | 424 - .../k8s.io/kube-openapi/pkg/builder/util.go | 61 - .../k8s.io/kube-openapi/pkg/common/common.go | 168 - .../kube-openapi/pkg/generators/openapi.go | 644 -- .../kube-openapi/pkg/handler/handler.go | 275 - .../kube-openapi/pkg/util/proto/document.go | 285 - .../kube-openapi/pkg/util/proto/openapi.go | 276 - .../pkg/util/proto/testing/openapi.go | 62 - .../pkg/util/proto/validation/errors.go | 79 - .../pkg/util/proto/validation/types.go | 298 - .../k8s.io/kube-openapi/pkg/util/trie.go | 79 - .../k8s.io/kube-openapi/pkg/util/util.go | 39 - 1170 files changed, 29967 insertions(+), 42619 deletions(-) delete mode 100644 cmd/vendor/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 cmd/vendor/github.com/PuerkitoBio/purell/purell.go delete mode 100644 cmd/vendor/github.com/PuerkitoBio/urlesc/urlesc.go rename cmd/vendor/github.com/{PuerkitoBio/urlesc => ghodss/yaml}/LICENSE (57%) create mode 100644 cmd/vendor/github.com/ghodss/yaml/fields.go create mode 100644 cmd/vendor/github.com/ghodss/yaml/yaml.go delete mode 100644 cmd/vendor/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 cmd/vendor/github.com/go-openapi/jsonpointer/pointer.go delete mode 100644 cmd/vendor/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 cmd/vendor/github.com/go-openapi/jsonreference/reference.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/LICENSE delete mode 100644 cmd/vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/contact_info.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/expander.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/external_docs.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/header.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/info.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/items.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/license.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/operation.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/path_item.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/paths.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/ref.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/response.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/responses.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/schema.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/security_scheme.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/spec.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/swagger.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/tag.go delete mode 100644 cmd/vendor/github.com/go-openapi/spec/xml_object.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/LICENSE delete mode 100644 cmd/vendor/github.com/go-openapi/swag/convert.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/json.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/loading.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/net.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/path.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/util.go delete mode 100644 cmd/vendor/github.com/go-openapi/swag/yaml.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 cmd/vendor/github.com/mailru/easyjson/benchmark/data.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/benchmark/data_codec.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/benchmark/data_var.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/easyjson/main.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/gen/decoder.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/gen/encoder.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/gen/generator.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/helpers.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/optional/opt.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/opt/opts.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/parser/parser.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/parser/parser_unix.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/parser/parser_windows.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/raw.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/data.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/errors.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/named_type.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/nested_easy.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/nothing.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/omitempty.go delete mode 100644 cmd/vendor/github.com/mailru/easyjson/tests/snake.go delete mode 100644 cmd/vendor/github.com/mitchellh/go-homedir/LICENSE delete mode 100644 cmd/vendor/github.com/mitchellh/go-homedir/homedir.go create mode 100644 cmd/vendor/github.com/spf13/pflag/bytes.go create mode 100644 cmd/vendor/github.com/spf13/pflag/duration_slice.go create mode 100644 cmd/vendor/github.com/spf13/pflag/int16.go create mode 100644 cmd/vendor/golang.org/x/net/http/httpguts/guts.go create mode 100644 cmd/vendor/golang.org/x/net/internal/socks/client.go create mode 100644 cmd/vendor/golang.org/x/net/internal/socks/socks.go create mode 100644 cmd/vendor/golang.org/x/net/internal/sockstest/server.go delete mode 100644 cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/catalog_gen.go delete mode 100644 cmd/vendor/golang.org/x/text/cmd/gotext/update.go delete mode 100644 cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go delete mode 100644 cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/test1.go create mode 100644 cmd/vendor/golang.org/x/tools/go/callgraph/cha/testdata/issue23925.go rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/bexport.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/bimport.go (89%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/exportdata.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/gcimporter.go (99%) create mode 100644 cmd/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/isAlias18.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/isAlias19.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/a.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/b.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/exports.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/issue15920.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/issue20046.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/p.go (100%) rename cmd/vendor/golang.org/x/tools/go/{gcimporter15 => internal/gcimporter}/testdata/versions/test.go (100%) rename cmd/vendor/golang.org/x/tools/{imports => internal/fastwalk}/fastwalk.go (83%) rename cmd/vendor/golang.org/x/tools/{imports => internal/fastwalk}/fastwalk_dirent_fileno.go (94%) rename cmd/vendor/golang.org/x/tools/{imports => internal/fastwalk}/fastwalk_dirent_ino.go (94%) rename cmd/vendor/golang.org/x/tools/{imports => internal/fastwalk}/fastwalk_portable.go (97%) rename cmd/vendor/golang.org/x/tools/{imports => internal/fastwalk}/fastwalk_unix.go (97%) create mode 100644 cmd/vendor/golang.org/x/tools/refactor/eg/testdata/I1.go create mode 100644 cmd/vendor/golang.org/x/tools/refactor/eg/testdata/J1.go rename cmd/vendor/{k8s.io/apiserver/pkg/apis/example/v1/types_swagger_doc_generated.go => gopkg.in/yaml.v2/NOTICE} (90%) create mode 100644 cmd/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/registry.go create mode 100644 cmd/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy.go create mode 100644 cmd/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor.go create mode 100644 cmd/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go create mode 100644 cmd/vendor/k8s.io/apimachinery/pkg/api/meta/table/table.go rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/conversion.go (73%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/deepcopy.go (98%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/doc.go (97%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/generated.pb.go (83%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/register.go (92%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/types.go (98%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/types_swagger_doc_generated.go (98%) rename cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (96%) create mode 100644 cmd/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/zz_generated.defaults.go delete mode 100644 cmd/vendor/k8s.io/apimachinery/pkg/apis/testapigroup/v1/types_swagger_doc_generated.go create mode 100644 cmd/vendor/k8s.io/apimachinery/pkg/util/duration/duration.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/admission/decorator.go delete mode 100644 cmd/vendor/k8s.io/apiserver/pkg/apis/example2/v1/types_swagger_doc_generated.go delete mode 100644 cmd/vendor/k8s.io/apiserver/pkg/endpoints/handlers/proxy.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/server/options/api_enablement.go delete mode 100644 cmd/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/plugins.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go rename cmd/vendor/k8s.io/{kube-openapi/pkg/util/proto => apiserver/pkg/server/resourceconfig}/doc.go (75%) create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag.go create mode 100644 cmd/vendor/k8s.io/apiserver/pkg/util/flag/noop.go create mode 100644 cmd/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go rename cmd/vendor/k8s.io/{kube-openapi/pkg/builder => apiserver/plugin/pkg/audit/buffered}/doc.go (65%) delete mode 100644 cmd/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/doc.go delete mode 100644 cmd/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/keystone.go delete mode 100644 cmd/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/provider.go create mode 100644 cmd/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go create mode 100644 cmd/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount_expansion.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go create mode 100644 cmd/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go create mode 100644 cmd/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go create mode 100644 cmd/vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattachment.go rename cmd/vendor/k8s.io/{kube-openapi/pkg/common => client-go/pkg/apis/clientauthentication}/doc.go (72%) create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/install.go create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/register.go create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/types.go rename cmd/vendor/k8s.io/{apiserver/pkg/endpoints/apiserver.go => client-go/pkg/apis/clientauthentication/v1alpha1/doc.go} (62%) create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/register.go create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/types.go create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.conversion.go create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.deepcopy.go rename cmd/vendor/k8s.io/{apimachinery/pkg/apis/meta => client-go/pkg/apis/clientauthentication}/v1alpha1/zz_generated.defaults.go (92%) create mode 100644 cmd/vendor/k8s.io/client-go/pkg/apis/clientauthentication/zz_generated.deepcopy.go delete mode 100644 cmd/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go create mode 100644 cmd/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go delete mode 100644 cmd/vendor/k8s.io/client-go/rest/versions.go rename cmd/vendor/k8s.io/{kube-openapi/pkg/util/proto/validation/validation.go => client-go/tools/bootstrap/token/api/doc.go} (64%) create mode 100644 cmd/vendor/k8s.io/client-go/tools/bootstrap/token/api/types.go create mode 100644 cmd/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers.go create mode 100644 cmd/vendor/k8s.io/gengo/examples/deepcopy-gen/output_tests/aliases/doc.go create mode 100644 cmd/vendor/k8s.io/gengo/examples/deepcopy-gen/output_tests/aliases/zz_generated.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/LICENSE delete mode 100644 cmd/vendor/k8s.io/kube-openapi/example/openapi-gen/main.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/aggregator/aggregator.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/builder/util.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/common/common.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/handler/handler.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/proto/document.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/proto/openapi.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/openapi.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/proto/validation/errors.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/proto/validation/types.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/trie.go delete mode 100644 cmd/vendor/k8s.io/kube-openapi/pkg/util/util.go diff --git a/cmd/Gopkg.lock b/cmd/Gopkg.lock index 6f05a11d28..ed98b6b173 100644 --- a/cmd/Gopkg.lock +++ b/cmd/Gopkg.lock @@ -1,55 +1,22 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - name = "github.com/PuerkitoBio/purell" - packages = ["."] - revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/PuerkitoBio/urlesc" - packages = ["."] - revision = "de5bf2ad457846296e2031421a34e2568e304e35" - [[projects]] name = "github.com/emicklei/go-restful" - packages = [ - ".", - "log" - ] + packages = ["log"] revision = "ff4f55a206334ef123e4f79bbf348980da81ca46" [[projects]] - branch = "master" - name = "github.com/go-openapi/jsonpointer" - packages = ["."] - revision = "779f45308c19820f1a69e9a4cd965f496e0da10f" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/jsonreference" - packages = ["."] - revision = "36d33bfe519efae5632669801b180bf1a245da3b" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/spec" + name = "github.com/ghodss/yaml" packages = ["."] - revision = "1de3e0542de65ad8d75452a595886fdd0befb363" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/swag" - packages = ["."] - revision = "84f4bee7c0a6db40e3166044c7983c1c32125429" + revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" + version = "v1.0.0" [[projects]] name = "github.com/gobuffalo/envy" packages = ["."] - revision = "50fabbbaf1e65fc9b739f37a00590c396485d84d" - version = "v1.4.0" + revision = "ef60bfc50c8f92d1ee64674d8ce7a48f1f67625e" + version = "v1.6.2" [[projects]] name = "github.com/gogo/protobuf" @@ -83,27 +50,11 @@ revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b" version = "v1.2.0" -[[projects]] - branch = "master" - name = "github.com/mailru/easyjson" - packages = [ - "buffer", - "jlexer", - "jwriter" - ] - revision = "32fa128f234d041f196a9f3e0fea5ac9772c08e1" - [[projects]] branch = "master" name = "github.com/markbates/inflect" packages = ["."] - revision = "80fa1ea41b0dc859816314ab0b85f07a6bc57923" - -[[projects]] - branch = "master" - name = "github.com/mitchellh/go-homedir" - packages = ["."] - revision = "b8bc1bf767474819792c23f32d8286a45736f1c6" + revision = "fbc6b23ce49e2578f572d2e72bb72fa03c7145de" [[projects]] name = "github.com/pkg/errors" @@ -118,22 +69,22 @@ [[projects]] name = "github.com/spf13/pflag" packages = ["."] - revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" - version = "v1.0.0" + revision = "583c0c0531f06d5278b7d917446061adc344b5cd" + version = "v1.0.1" [[projects]] branch = "master" name = "golang.org/x/net" packages = [ + "http/httpguts", "http2", "http2/hpack", "idna", "lex/httplex" ] - revision = "cbe0f9307d0156177f9dd5dc85da1a31abc5f2fb" + revision = "5f9ae10d9af5b1c89ae6904293b14b064d4ada23" [[projects]] - branch = "master" name = "golang.org/x/text" packages = [ "collate", @@ -149,49 +100,53 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable", - "width" + "unicode/rangetable" ] - revision = "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" [[projects]] branch = "master" name = "golang.org/x/tools" packages = [ "go/ast/astutil", - "imports" + "imports", + "internal/fastwalk" ] - revision = "ce871d178848e3eea1e8795e5cfb74053dde4bb9" + revision = "8e070db38e5c55da6a85c81878ab769bf5667848" [[projects]] name = "gopkg.in/inf.v0" packages = ["."] - revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - version = "v0.9.0" + revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" + version = "v0.9.1" [[projects]] - branch = "v2" name = "gopkg.in/yaml.v2" packages = ["."] - revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" [[projects]] - branch = "release-1.9" name = "k8s.io/api" - packages = ["rbac/v1"] - revision = "acf347b865f29325eb61f4cd2df11e86e073a5ee" + packages = [ + "apps/v1", + "core/v1", + "rbac/v1" + ] + revision = "73d903622b7391f3312dcbac6483fed484e185f8" + version = "kubernetes-1.10.0" [[projects]] - branch = "release-1.9" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", "pkg/apis/apiextensions/v1beta1" ] - revision = "b89f5ce12ce6e022fc3e9d7586d61346e694d56e" + revision = "4347b330d0ff094db860f2f75fa725b4f4b53618" + version = "kubernetes-1.10.1" [[projects]] - branch = "release-1.9" name = "k8s.io/apimachinery" packages = [ "pkg/api/resource", @@ -216,19 +171,20 @@ "pkg/watch", "third_party/forked/golang/reflect" ] - revision = "19e3f5aa3adca672c153d324e6b7d82ff8935f03" + revision = "302974c03f7e50f16561ba237db776ab93594ef6" + version = "kubernetes-1.10.0" [[projects]] - branch = "release-1.9" name = "k8s.io/apiserver" packages = ["pkg/util/logs"] - revision = "40b00dd493d8fb98c255f0c6427f97fbf865a538" + revision = "06e4be4fafa2c9356e02424aac4e714e2ebeff60" + version = "kubernetes-1.10.1" [[projects]] - branch = "release-6.0" name = "k8s.io/client-go" packages = ["util/homedir"] - revision = "9389c055a838d4f208b699b3c7c51b70f2368861" + revision = "989be4278f353e42f26c416c53757d16fcff77db" + version = "kubernetes-1.10.1" [[projects]] branch = "master" @@ -240,17 +196,11 @@ "parser", "types" ] - revision = "8394c995ab8fbe52216f38d0e1a37de36d820528" - -[[projects]] - branch = "master" - name = "k8s.io/kube-openapi" - packages = ["pkg/common"] - revision = "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + revision = "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "09800e4ab270020024914a658472caa8dd3bc8b2d6b324ba79aacc1ac46d2811" + inputs-digest = "53c0546d5938231df9b5bf3a3e878723d37026c0048dd7238a5e57dcc5e47992" solver-name = "gps-cdcl" solver-version = 1 diff --git a/cmd/Gopkg.toml b/cmd/Gopkg.toml index 333f681e77..02788c91bf 100644 --- a/cmd/Gopkg.toml +++ b/cmd/Gopkg.toml @@ -25,21 +25,21 @@ revision = "f62e98d28ab7ad31d707ba837a966378465c7b57" [[constraint]] - branch = "release-1.9" + version = "kubernetes-1.10.1" name = "k8s.io/api" [[constraint]] - branch = "release-1.9" + version = "kubernetes-1.10.1" name = "k8s.io/apiextensions-apiserver" [[constraint]] - branch = "release-1.9" + version = "kubernetes-1.10.1" name = "k8s.io/apimachinery" [[constraint]] - branch = "release-1.9" + version = "kubernetes-1.10.1" name = "k8s.io/apiserver" [[constraint]] - branch = "release-6.0" + version = "kubernetes-1.10.1" name = "k8s.io/client-go" diff --git a/cmd/vendor/github.com/PuerkitoBio/purell/LICENSE b/cmd/vendor/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986dea7..0000000000 --- a/cmd/vendor/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cmd/vendor/github.com/PuerkitoBio/purell/purell.go b/cmd/vendor/github.com/PuerkitoBio/purell/purell.go deleted file mode 100644 index 645e1b76f7..0000000000 --- a/cmd/vendor/github.com/PuerkitoBio/purell/purell.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package purell offers URL normalization as described on the wikipedia page: -http://en.wikipedia.org/wiki/URL_normalization -*/ -package purell - -import ( - "bytes" - "fmt" - "net/url" - "regexp" - "sort" - "strconv" - "strings" - - "github.com/PuerkitoBio/urlesc" - "golang.org/x/net/idna" - "golang.org/x/text/unicode/norm" - "golang.org/x/text/width" -) - -// A set of normalization flags determines how a URL will -// be normalized. -type NormalizationFlags uint - -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) - -const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) -var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) -var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) -var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) -var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) -var rxEmptyPort = regexp.MustCompile(`:+$`) - -// Map of flags to implementation function. -// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically -// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. - -// Since maps have undefined traversing order, make a slice of ordered keys -var flagsOrder = []NormalizationFlags{ - FlagLowercaseScheme, - FlagLowercaseHost, - FlagRemoveDefaultPort, - FlagRemoveDirectoryIndex, - FlagRemoveDotSegments, - FlagRemoveFragment, - FlagForceHTTP, // Must be after remove default port (because https=443/http=80) - FlagRemoveDuplicateSlashes, - FlagRemoveWWW, - FlagAddWWW, - FlagSortQuery, - FlagDecodeDWORDHost, - FlagDecodeOctalHost, - FlagDecodeHexHost, - FlagRemoveUnnecessaryHostDots, - FlagRemoveEmptyPortSeparator, - FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last - FlagAddTrailingSlash, -} - -// ... and then the map, where order is unimportant -var flags = map[NormalizationFlags]func(*url.URL){ - FlagLowercaseScheme: lowercaseScheme, - FlagLowercaseHost: lowercaseHost, - FlagRemoveDefaultPort: removeDefaultPort, - FlagRemoveDirectoryIndex: removeDirectoryIndex, - FlagRemoveDotSegments: removeDotSegments, - FlagRemoveFragment: removeFragment, - FlagForceHTTP: forceHTTP, - FlagRemoveDuplicateSlashes: removeDuplicateSlashes, - FlagRemoveWWW: removeWWW, - FlagAddWWW: addWWW, - FlagSortQuery: sortQuery, - FlagDecodeDWORDHost: decodeDWORDHost, - FlagDecodeOctalHost: decodeOctalHost, - FlagDecodeHexHost: decodeHexHost, - FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, - FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, - FlagRemoveTrailingSlash: removeTrailingSlash, - FlagAddTrailingSlash: addTrailingSlash, -} - -// MustNormalizeURLString returns the normalized string, and panics if an error occurs. -// It takes an URL string as input, as well as the normalization flags. -func MustNormalizeURLString(u string, f NormalizationFlags) string { - result, e := NormalizeURLString(u, f) - if e != nil { - panic(e) - } - return result -} - -// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. -// It takes an URL string as input, as well as the normalization flags. -func NormalizeURLString(u string, f NormalizationFlags) (string, error) { - parsed, err := url.Parse(u) - if err != nil { - return "", err - } - - if f&FlagLowercaseHost == FlagLowercaseHost { - parsed.Host = strings.ToLower(parsed.Host) - } - - // The idna package doesn't fully conform to RFC 5895 - // (https://tools.ietf.org/html/rfc5895), so we do it here. - // Taken from Go 1.8 cycle source, courtesy of bradfitz. - // TODO: Remove when (if?) idna package conforms to RFC 5895. - parsed.Host = width.Fold.String(parsed.Host) - parsed.Host = norm.NFC.String(parsed.Host) - if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { - return "", err - } - - return NormalizeURL(parsed, f), nil -} - -// NormalizeURL returns the normalized string. -// It takes a parsed URL object as input, as well as the normalization flags. -func NormalizeURL(u *url.URL, f NormalizationFlags) string { - for _, k := range flagsOrder { - if f&k == k { - flags[k](u) - } - } - return urlesc.Escape(u) -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { - return "" - } - return val - }) - } -} - -func removeTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if strings.HasSuffix(u.Path, "/") { - u.Path = u.Path[:l-1] - } - } else if l = len(u.Host); l > 0 { - if strings.HasSuffix(u.Host, "/") { - u.Host = u.Host[:l-1] - } - } -} - -func addTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } else if l = len(u.Host); l > 0 { - if !strings.HasSuffix(u.Host, "/") { - u.Host += "/" - } - } -} - -func removeDotSegments(u *url.URL) { - if len(u.Path) > 0 { - var dotFree []string - var lastIsDot bool - - sections := strings.Split(u.Path, "/") - for _, s := range sections { - if s == ".." { - if len(dotFree) > 0 { - dotFree = dotFree[:len(dotFree)-1] - } - } else if s != "." { - dotFree = append(dotFree, s) - } - lastIsDot = (s == "." || s == "..") - } - // Special case if host does not end with / and new path does not begin with / - u.Path = strings.Join(dotFree, "/") - if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - // Special case if the last segment was a dot, make sure the path ends with a slash - if lastIsDot && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } -} - -func removeDirectoryIndex(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") - } -} - -func removeFragment(u *url.URL) { - u.Fragment = "" -} - -func forceHTTP(u *url.URL) { - if strings.ToLower(u.Scheme) == "https" { - u.Scheme = "http" - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} - -func removeWWW(u *url.URL) { - if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = u.Host[4:] - } -} - -func addWWW(u *url.URL) { - if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = "www." + u.Host - } -} - -func sortQuery(u *url.URL) { - q := u.Query() - - if len(q) > 0 { - arKeys := make([]string, len(q)) - i := 0 - for k, _ := range q { - arKeys[i] = k - i++ - } - sort.Strings(arKeys) - buf := new(bytes.Buffer) - for _, k := range arKeys { - sort.Strings(q[k]) - for _, v := range q[k] { - if buf.Len() > 0 { - buf.WriteRune('&') - } - buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) - } - } - - // Rebuild the raw query string - u.RawQuery = buf.String() - } -} - -func decodeDWORDHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { - var parts [4]int64 - - dword, _ := strconv.ParseInt(matches[1], 10, 0) - for i, shift := range []uint{24, 16, 8, 0} { - parts[i] = dword >> shift & 0xFF - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) - } - } -} - -func decodeOctalHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { - var parts [4]int64 - - for i := 1; i <= 4; i++ { - parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) - } - } -} - -func decodeHexHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { - // Conversion is safe because of regex validation - parsed, _ := strconv.ParseInt(matches[1], 16, 0) - // Set host as DWORD (base 10) encoded host - u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) - // The rest is the same as decoding a DWORD host - decodeDWORDHost(u) - } - } -} - -func removeUnncessaryHostDots(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { - // Trim the leading and trailing dots - u.Host = strings.Trim(matches[1], ".") - if len(matches) > 2 { - u.Host += matches[2] - } - } - } -} - -func removeEmptyPortSeparator(u *url.URL) { - if len(u.Host) > 0 { - u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") - } -} diff --git a/cmd/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/cmd/vendor/github.com/PuerkitoBio/urlesc/urlesc.go deleted file mode 100644 index 1b84624594..0000000000 --- a/cmd/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package urlesc implements query escaping as per RFC 3986. -// It contains some parts of the net/url package, modified so as to allow -// some reserved characters incorrectly escaped by net/url. -// See https://github.com/golang/go/issues/5684 -package urlesc - -import ( - "bytes" - "net/url" - "strings" -) - -type encoding int - -const ( - encodePath encoding = 1 + iota - encodeUserPassword - encodeQueryComponent - encodeFragment -) - -// Return true if the specified character should be escaped when -// appearing in a URL string, according to RFC 3986. -func shouldEscape(c byte, mode encoding) bool { - // §2.3 Unreserved characters (alphanum) - if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { - return false - } - - switch c { - case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) - return false - - // §2.2 Reserved characters (reserved) - case ':', '/', '?', '#', '[', ']', '@', // gen-delims - '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims - // Different sections of the URL allow a few of - // the reserved characters to appear unescaped. - switch mode { - case encodePath: // §3.3 - // The RFC allows sub-delims and : @. - // '/', '[' and ']' can be used to assign meaning to individual path - // segments. This package only manipulates the path as a whole, - // so we allow those as well. That leaves only ? and # to escape. - return c == '?' || c == '#' - - case encodeUserPassword: // §3.2.1 - // The RFC allows : and sub-delims in - // userinfo. The parsing of userinfo treats ':' as special so we must escape - // all the gen-delims. - return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' - - case encodeQueryComponent: // §3.4 - // The RFC allows / and ?. - return c != '/' && c != '?' - - case encodeFragment: // §4.1 - // The RFC text is silent but the grammar allows - // everything, so escape nothing but # - return c == '#' - } - } - - // Everything else must be escaped. - return true -} - -// QueryEscape escapes the string so it can be safely placed -// inside a URL query. -func QueryEscape(s string) string { - return escape(s, encodeQueryComponent) -} - -func escape(s string, mode encoding) string { - spaceCount, hexCount := 0, 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c, mode) { - if c == ' ' && mode == encodeQueryComponent { - spaceCount++ - } else { - hexCount++ - } - } - } - - if spaceCount == 0 && hexCount == 0 { - return s - } - - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - switch c := s[i]; { - case c == ' ' && mode == encodeQueryComponent: - t[j] = '+' - j++ - case shouldEscape(c, mode): - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - default: - t[j] = s[i] - j++ - } - } - return string(t) -} - -var uiReplacer = strings.NewReplacer( - "%21", "!", - "%27", "'", - "%28", "(", - "%29", ")", - "%2A", "*", -) - -// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. -func unescapeUserinfo(s string) string { - return uiReplacer.Replace(s) -} - -// Escape reassembles the URL into a valid URL string. -// The general form of the result is one of: -// -// scheme:opaque -// scheme://userinfo@host/path?query#fragment -// -// If u.Opaque is non-empty, String uses the first form; -// otherwise it uses the second form. -// -// In the second form, the following rules apply: -// - if u.Scheme is empty, scheme: is omitted. -// - if u.User is nil, userinfo@ is omitted. -// - if u.Host is empty, host/ is omitted. -// - if u.Scheme and u.Host are empty and u.User is nil, -// the entire scheme://userinfo@host/ is omitted. -// - if u.Host is non-empty and u.Path begins with a /, -// the form host/path does not add its own /. -// - if u.RawQuery is empty, ?query is omitted. -// - if u.Fragment is empty, #fragment is omitted. -func Escape(u *url.URL) string { - var buf bytes.Buffer - if u.Scheme != "" { - buf.WriteString(u.Scheme) - buf.WriteByte(':') - } - if u.Opaque != "" { - buf.WriteString(u.Opaque) - } else { - if u.Scheme != "" || u.Host != "" || u.User != nil { - buf.WriteString("//") - if ui := u.User; ui != nil { - buf.WriteString(unescapeUserinfo(ui.String())) - buf.WriteByte('@') - } - if h := u.Host; h != "" { - buf.WriteString(h) - } - } - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - buf.WriteString(escape(u.Path, encodePath)) - } - if u.RawQuery != "" { - buf.WriteByte('?') - buf.WriteString(u.RawQuery) - } - if u.Fragment != "" { - buf.WriteByte('#') - buf.WriteString(escape(u.Fragment, encodeFragment)) - } - return buf.String() -} diff --git a/cmd/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/cmd/vendor/github.com/ghodss/yaml/LICENSE similarity index 57% rename from cmd/vendor/github.com/PuerkitoBio/urlesc/LICENSE rename to cmd/vendor/github.com/ghodss/yaml/LICENSE index 7448756763..7805d36de7 100644 --- a/cmd/vendor/github.com/PuerkitoBio/urlesc/LICENSE +++ b/cmd/vendor/github.com/ghodss/yaml/LICENSE @@ -1,3 +1,26 @@ +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 diff --git a/cmd/vendor/github.com/ghodss/yaml/fields.go b/cmd/vendor/github.com/ghodss/yaml/fields.go new file mode 100644 index 0000000000..5860074026 --- /dev/null +++ b/cmd/vendor/github.com/ghodss/yaml/fields.go @@ -0,0 +1,501 @@ +// 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 +} diff --git a/cmd/vendor/github.com/ghodss/yaml/yaml.go b/cmd/vendor/github.com/ghodss/yaml/yaml.go new file mode 100644 index 0000000000..4fb4054a8b --- /dev/null +++ b/cmd/vendor/github.com/ghodss/yaml/yaml.go @@ -0,0 +1,277 @@ +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 +} diff --git a/cmd/vendor/github.com/go-openapi/jsonpointer/LICENSE b/cmd/vendor/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/cmd/vendor/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cmd/vendor/github.com/go-openapi/jsonpointer/pointer.go b/cmd/vendor/github.com/go-openapi/jsonpointer/pointer.go deleted file mode 100644 index fe2d6ee574..0000000000 --- a/cmd/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonpointer -// repository-desc An implementation of JSON Pointer - Go language -// -// description Main and unique file. -// -// created 25-02-2013 - -package jsonpointer - -import ( - "errors" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/go-openapi/swag" -) - -const ( - emptyPointer = `` - pointerSeparator = `/` - - invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator -) - -var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() -var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() - -// JSONPointable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONPointable interface { - JSONLookup(string) (interface{}, error) -} - -// JSONSetable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONSetable interface { - JSONSet(string, interface{}) error -} - -// New creates a new json pointer for the given string -func New(jsonPointerString string) (Pointer, error) { - - var p Pointer - err := p.parse(jsonPointerString) - return p, err - -} - -// Pointer the json pointer reprsentation -type Pointer struct { - referenceTokens []string -} - -// "Constructor", parses the given string JSON pointer -func (p *Pointer) parse(jsonPointerString string) error { - - var err error - - if jsonPointerString != emptyPointer { - if !strings.HasPrefix(jsonPointerString, pointerSeparator) { - err = errors.New(invalidStart) - } else { - referenceTokens := strings.Split(jsonPointerString, pointerSeparator) - for _, referenceToken := range referenceTokens[1:] { - p.referenceTokens = append(p.referenceTokens, referenceToken) - } - } - } - - return err -} - -// Get uses the pointer to retrieve a value from a JSON document -func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) { - return p.get(document, swag.DefaultJSONNameProvider) -} - -// Set uses the pointer to set a value from a JSON document -func (p *Pointer) Set(document interface{}, value interface{}) (interface{}, error) { - return document, p.set(document, value, swag.DefaultJSONNameProvider) -} - -// GetForToken gets a value for a json pointer token 1 level deep -func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) { - return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider) -} - -// SetForToken gets a value for a json pointer token 1 level deep -func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) { - return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) -} - -func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - switch kind { - - case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return nil, kind, err - } - return r, kind, nil - } - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return nil, kind, fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - return fld.Interface(), kind, nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if mv.IsValid() && !swag.IsZero(mv) { - return mv.Interface(), kind, nil - } - return nil, kind, fmt.Errorf("object has no key %q", decodedToken) - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return nil, kind, err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - return elem.Interface(), kind, nil - - default: - return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error { - rValue := reflect.Indirect(reflect.ValueOf(node)) - switch rValue.Kind() { - - case reflect.Struct: - if ns, ok := node.(JSONSetable); ok { // pointer impl - return ns.JSONSet(decodedToken, data) - } - - if rValue.Type().Implements(jsonSetableType) { - return node.(JSONSetable).JSONSet(decodedToken, data) - } - - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.IsValid() { - fld.Set(reflect.ValueOf(data)) - } - return nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - rValue.SetMapIndex(kv, reflect.ValueOf(data)) - return nil - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if !elem.CanSet() { - return fmt.Errorf("can't set slice index %s to %v", decodedToken, data) - } - elem.Set(reflect.ValueOf(data)) - return nil - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - kind := reflect.Invalid - - // Full document when empty - if len(p.referenceTokens) == 0 { - return node, kind, nil - } - - for _, token := range p.referenceTokens { - - decodedToken := Unescape(token) - - r, knd, err := getSingleImpl(node, decodedToken, nameProvider) - if err != nil { - return nil, knd, err - } - node, kind = r, knd - - } - - rValue := reflect.ValueOf(node) - kind = rValue.Kind() - - return node, kind, nil -} - -func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) error { - knd := reflect.ValueOf(node).Kind() - - if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { - return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values") - } - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - // Full document when empty - if len(p.referenceTokens) == 0 { - return nil - } - - lastI := len(p.referenceTokens) - 1 - for i, token := range p.referenceTokens { - isLastToken := i == lastI - decodedToken := Unescape(token) - - if isLastToken { - - return setSingleImpl(node, data, decodedToken, nameProvider) - } - - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - switch kind { - - case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return err - } - fld := reflect.ValueOf(r) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = r - continue - } - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = fld.Interface() - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if !mv.IsValid() { - return fmt.Errorf("object has no key %q", decodedToken) - } - if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr { - node = mv.Addr().Interface() - continue - } - node = mv.Interface() - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr { - node = elem.Addr().Interface() - continue - } - node = elem.Interface() - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - - } - - return nil -} - -// DecodedTokens returns the decoded tokens -func (p *Pointer) DecodedTokens() []string { - result := make([]string, 0, len(p.referenceTokens)) - for _, t := range p.referenceTokens { - result = append(result, Unescape(t)) - } - return result -} - -// IsEmpty returns true if this is an empty json pointer -// this indicates that it points to the root document -func (p *Pointer) IsEmpty() bool { - return len(p.referenceTokens) == 0 -} - -// Pointer to string representation function -func (p *Pointer) String() string { - - if len(p.referenceTokens) == 0 { - return emptyPointer - } - - pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) - - return pointerString -} - -// Specific JSON pointer encoding here -// ~0 => ~ -// ~1 => / -// ... and vice versa - -const ( - encRefTok0 = `~0` - encRefTok1 = `~1` - decRefTok0 = `~` - decRefTok1 = `/` -) - -// Unescape unescapes a json pointer reference token string to the original representation -func Unescape(token string) string { - step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) - step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) - return step2 -} - -// Escape escapes a pointer reference token string -func Escape(token string) string { - step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) - step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) - return step2 -} diff --git a/cmd/vendor/github.com/go-openapi/jsonreference/LICENSE b/cmd/vendor/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/cmd/vendor/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cmd/vendor/github.com/go-openapi/jsonreference/reference.go b/cmd/vendor/github.com/go-openapi/jsonreference/reference.go deleted file mode 100644 index 3bc0a6e26f..0000000000 --- a/cmd/vendor/github.com/go-openapi/jsonreference/reference.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonreference -// repository-desc An implementation of JSON Reference - Go language -// -// description Main and unique file. -// -// created 26-02-2013 - -package jsonreference - -import ( - "errors" - "net/url" - "strings" - - "github.com/PuerkitoBio/purell" - "github.com/go-openapi/jsonpointer" -) - -const ( - fragmentRune = `#` -) - -// New creates a new reference for the given string -func New(jsonReferenceString string) (Ref, error) { - - var r Ref - err := r.parse(jsonReferenceString) - return r, err - -} - -// MustCreateRef parses the ref string and panics when it's invalid. -// Use the New method for a version that returns an error -func MustCreateRef(ref string) Ref { - r, err := New(ref) - if err != nil { - panic(err) - } - return r -} - -// Ref represents a json reference object -type Ref struct { - referenceURL *url.URL - referencePointer jsonpointer.Pointer - - HasFullURL bool - HasURLPathOnly bool - HasFragmentOnly bool - HasFileScheme bool - HasFullFilePath bool -} - -// GetURL gets the URL for this reference -func (r *Ref) GetURL() *url.URL { - return r.referenceURL -} - -// GetPointer gets the json pointer for this reference -func (r *Ref) GetPointer() *jsonpointer.Pointer { - return &r.referencePointer -} - -// String returns the best version of the url for this reference -func (r *Ref) String() string { - - if r.referenceURL != nil { - return r.referenceURL.String() - } - - if r.HasFragmentOnly { - return fragmentRune + r.referencePointer.String() - } - - return r.referencePointer.String() -} - -// IsRoot returns true if this reference is a root document -func (r *Ref) IsRoot() bool { - return r.referenceURL != nil && - !r.IsCanonical() && - !r.HasURLPathOnly && - r.referenceURL.Fragment == "" -} - -// IsCanonical returns true when this pointer starts with http(s):// or file:// -func (r *Ref) IsCanonical() bool { - return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL) -} - -// "Constructor", parses the given string JSON reference -func (r *Ref) parse(jsonReferenceString string) error { - - parsed, err := url.Parse(jsonReferenceString) - if err != nil { - return err - } - - r.referenceURL, _ = url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) - refURL := r.referenceURL - - if refURL.Scheme != "" && refURL.Host != "" { - r.HasFullURL = true - } else { - if refURL.Path != "" { - r.HasURLPathOnly = true - } else if refURL.RawQuery == "" && refURL.Fragment != "" { - r.HasFragmentOnly = true - } - } - - r.HasFileScheme = refURL.Scheme == "file" - r.HasFullFilePath = strings.HasPrefix(refURL.Path, "/") - - // invalid json-pointer error means url has no json-pointer fragment. simply ignore error - r.referencePointer, _ = jsonpointer.New(refURL.Fragment) - - return nil -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - childURL := child.GetURL() - parentURL := r.GetURL() - if childURL == nil { - return nil, errors.New("child url is nil") - } - if parentURL == nil { - return &child, nil - } - - ref, err := New(parentURL.ResolveReference(childURL).String()) - if err != nil { - return nil, err - } - return &ref, nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/LICENSE b/cmd/vendor/github.com/go-openapi/spec/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cmd/vendor/github.com/go-openapi/spec/bindata.go b/cmd/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index 9afb5df194..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,260 +0,0 @@ -// Code generated by go-bindata. -// sources: -// schemas/jsonschema-draft-04.json -// schemas/v2/schema.json -// DO NOT EDIT! - -package spec - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04JSON = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x57\x3b\x6f\xdb\x3e\x10\xdf\xf3\x29\x08\x26\x63\xf2\x97\xff\x40\x27\x6f\x45\xbb\x18\x68\xd1\x0c\xdd\x0c\x0f\xb4\x75\xb2\x19\x50\xa4\x42\x51\x81\x0d\x43\xdf\xbd\xa0\xa8\x07\x29\x91\x92\x2d\xbb\x8d\x97\x28\xbc\xd7\xef\x8e\xf7\xe2\xf9\x01\x21\x84\x30\x8d\xf1\x12\xe1\x83\x52\xd9\x32\x8a\xde\x72\xc1\x5f\xf2\xdd\x01\x52\xf2\x9f\x90\xfb\x28\x96\x24\x51\x2f\x8b\x2f\x91\x39\x7b\xc4\xcf\x46\xe8\xc9\xfc\x3f\x43\x32\x86\x7c\x27\x69\xa6\xa8\xe0\x5a\xfa\x9b\x90\x80\x0c\x0b\x4a\x41\x91\x5a\x45\xc7\x9d\x50\x4e\x35\x73\x8e\x97\xc8\x20\xae\x08\x86\xed\xab\x94\xe4\xe4\x10\x2a\xa2\x3a\x65\xa0\x95\x93\x8a\xfc\xec\x12\x53\xca\x57\x0a\x52\xad\xef\xff\x1e\x89\xd6\xe7\x67\x84\x9f\x24\x24\x5a\xc5\x23\x46\x65\xcb\x54\x76\xfc\x38\x13\x39\x55\xf4\x03\x56\x5c\xc1\x1e\x64\x18\x04\xad\x19\x86\x30\x68\x5a\xa4\x78\x89\x16\x97\xe8\xff\x0e\x09\x29\x98\x5a\x0c\xed\x10\xc6\x7e\x69\xa8\x6b\x07\x76\x64\x45\x2e\xea\x63\x45\xe5\xb3\x66\x8e\x8d\x4e\x0d\x01\x95\x68\xe3\x85\x91\xd3\x34\x63\xf0\xfb\x94\x41\x3e\x34\x0d\xbc\x72\x60\xdd\x46\x1a\xe1\xad\x10\x0c\x08\xd7\x9f\xad\xe3\x08\xf3\x82\x31\xf3\x37\xdd\x9a\x13\xb1\x7d\x83\x9d\xd2\x5f\xb9\x92\x94\xef\x71\xc8\x7e\x45\x9d\x73\xcf\xd6\x65\x36\x7c\x8d\xa9\xf2\xf2\x94\x28\x38\x7d\x2f\xa0\xa1\x2a\x59\x40\x07\xf3\xc1\x02\xdb\xda\x68\x1c\x33\xa7\x99\x14\x19\x48\x45\x7b\xd1\x33\x45\x17\xf0\xa6\x46\xd9\x03\x92\x08\x99\x12\x7d\x57\xb8\x90\x14\x7b\x63\xd5\x15\xe5\xbd\x35\x2b\xaa\x18\x4c\xea\xf5\x8a\xba\xf5\x3e\x4b\x41\x93\xa5\x67\xfb\x38\x2d\x98\xa2\x19\x83\x2a\xf7\x03\x6a\x9b\x74\x0b\x56\x5e\x8f\x02\xc7\x1d\x2b\x72\xfa\x01\x3f\x5b\x16\xf7\xc6\x6d\xfb\xe4\x58\xb3\x8c\x1b\xf7\x0a\x77\x86\xa6\xb4\xb4\xf5\xe4\x92\xbb\xa0\x24\x84\xe5\x01\x84\xad\x13\x37\x21\x9c\xd2\x72\x0b\x42\x72\xfc\x01\x7c\xaf\x0e\xbd\x9e\x3b\xd5\xbc\x1c\x1f\xaf\xd6\xd0\xb6\x52\xb7\xdf\x12\xa5\x40\x4e\xe7\x68\xb0\x78\x24\xec\xe1\xe8\x0f\x26\x89\xe3\x0a\x0a\x61\x4d\x23\xe9\xf7\x70\x7e\x32\x3d\xdc\x39\xd6\xbf\xf3\x30\xd0\xfd\xf6\x55\xb3\x79\x27\x96\xfe\x6d\x82\x37\x73\xf6\x8f\x36\x3a\x03\xa4\x6d\x7d\x1c\x9e\x73\x35\xf6\x18\xbf\x15\x76\x4a\x8e\x2b\xcf\x00\xbf\x2a\x99\xae\x55\xe0\xcf\x25\x77\x68\xfc\x95\xba\x79\x75\x06\xcb\x5c\x77\x67\x69\xf1\xfb\x2c\xe1\xbd\xa0\x12\xe2\x31\x45\xf6\x30\x0f\x14\xc8\xab\x7f\x60\x4e\x27\xe0\x3f\xaf\x92\xd0\x6a\x8a\x82\xdb\xc0\xa4\xbb\x63\x65\x34\x0d\x28\xb0\x6b\x7c\x1e\x1e\xd3\x51\xc7\x6e\xf4\x33\x60\xc5\x90\x01\x8f\x81\xef\xee\x88\x68\x90\x69\x23\xb9\x8a\x2e\x69\x98\x7d\xa6\x91\x32\x1a\xc8\x6e\x9c\x13\x7f\x10\xea\xcd\xfd\x4e\xef\xa6\xb1\x25\xd9\xde\x22\x8d\xfa\x59\x63\xc5\x0d\x80\xf5\x28\xf1\xd6\xb9\x37\x9e\xa3\xee\xb5\x4c\xbe\x37\xe0\x55\xc6\x27\x82\x75\x49\xd0\xda\xe0\xb9\x1d\xca\xbf\x5b\xd4\xcf\xbf\x0b\x47\xac\x2d\x59\x07\xfe\x7a\x49\xc1\x61\xa6\x24\x17\x2a\xf0\xbe\x2e\xdb\x17\x7f\xa0\x3c\x7d\x4b\xf3\xba\xdb\xc3\xed\x06\xee\xdb\x5e\xd7\xdd\x42\x5c\x47\xb2\xb3\x68\x75\x8c\xf2\xe1\x4f\x00\x00\x00\xff\xff\x4e\x9b\x8d\xdf\x17\x11\x00\x00") - -func jsonschemaDraft04JSONBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04JSON, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04JSON() (*asset, error) { - bytes, err := jsonschemaDraft04JSONBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4375, mode: os.FileMode(420), modTime: time.Unix(1482389892, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _v2SchemaJSON = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\x87\x15\xca\x15\xe5\xf5\x94\x46\x9f\x33\x1a\x0c\x9a\xb1\x5a\xd9\x6a\x95\xcd\xcb\x7e\xec\x9a\xc5\x94\x3b\x37\x26\x31\xd7\xfc\xe4\x1f\x13\x8c\x31\x75\x9c\xba\xf7\x87\x3c\xa1\xb7\x4f\x17\x1b\x09\x82\x98\xc4\x70\x95\xd3\xe8\x4c\x48\x5a\xa6\xd6\x2a\x3d\x56\x42\x80\x9f\xaf\xae\x2e\x50\x0c\x42\xe0\x35\x34\x3c\x8a\x62\x03\x37\xba\xb2\x27\x04\xda\x25\x8d\x06\xe2\xa0\x13\x8a\xf3\xf5\xec\x10\x72\x67\x88\x90\x3d\x4b\x64\xeb\xaa\xda\x8f\xf7\x5a\x75\x47\x9a\xa8\x51\x70\x26\xd2\x38\xc6\x7c\xbb\x57\xfc\xbd\xe4\x04\x56\xa8\xa0\x54\x9a\x45\xd5\xf7\x0f\x16\xfc\x57\x1c\x3c\xdf\x23\xba\x77\x38\xda\x16\x4b\x31\x53\x6a\x4d\x9a\x15\x63\xe7\xe1\x18\x69\x9f\x22\xe0\x24\xbb\x94\x4b\x97\xee\x2d\xf9\x70\x87\x72\x7b\xe6\xc4\x33\x2a\x66\x5e\x1c\x35\x72\xe3\x2d\xda\x73\xe4\xc7\x51\x6d\xa4\xa1\x2a\x4f\xde\x94\xcb\xb2\x3e\x31\x48\xae\x82\xce\xc9\xc8\x65\xcd\xc3\xb7\x34\xb6\x2b\xdf\x58\x65\x78\x6e\x73\xac\x5e\x24\x0d\x3f\xdc\x70\x23\xc6\xda\x52\x0b\x2d\x63\x7d\xa9\x49\x2d\x54\x48\x28\xc0\x12\x9c\xe3\x63\xc9\x58\x04\x98\x36\x07\xc8\x0a\xa7\x91\xd4\xf0\xbc\xc1\xa8\xb9\x70\xd0\xc6\xa9\xb6\x78\x80\x5a\xa3\xb4\x2c\xf4\x18\x0b\x8a\x9d\xd0\xb4\x55\x10\xee\x0d\xc5\xd6\xe0\x99\x93\xdc\xa1\x04\xbb\xf1\xa7\x23\xd1\xd1\x97\x8c\x87\x13\x0a\x21\x02\xe9\x99\x25\xed\x20\xc5\x92\x66\x3c\x32\x9c\xd6\x06\xb0\x31\x5c\x86\x29\x0a\xcb\x60\x33\x12\xa5\x91\xfc\x96\x75\xd0\x59\xd7\x13\xbd\xd3\x23\x79\xdd\x2a\x90\xa6\x38\x06\x91\x39\x7f\x20\x72\x03\x1c\x2d\x01\x61\xba\x45\x37\x38\x22\x61\x8e\x71\x85\xc4\x32\x15\x28\x60\x61\x16\xb8\x3d\x29\xdc\x4d\x3d\x2f\x12\x13\x7d\xc8\x7e\x37\xee\xa8\x7f\xfa\xdb\xcb\x17\xff\x77\xfd\xf9\x7f\xee\x9f\x3d\xfe\xcf\xa7\xa7\x45\xfb\xcf\x1e\xf7\xf3\xe0\xff\xc4\x51\x0a\x8e\x4c\xcb\x01\xdc\x0a\x65\xb2\x01\x83\xed\x3d\xe4\xa9\xa3\x4e\x2d\x59\xc5\xe8\x2f\x48\x7d\x5a\x6e\x37\xbf\x5c\x9f\x35\x13\x64\x14\xfa\xef\x0b\x68\xa6\x0d\xb4\x8e\xf1\xa8\xff\xbb\x60\xf4\x03\x64\xab\x5b\x81\x65\x51\xe6\xda\xca\xfa\xf0\xb0\xac\x3e\x9c\xca\x26\x0e\x1d\xdb\x57\x5b\xbb\xb4\x9a\xa6\xb6\x9b\x1a\x6b\xd1\x9a\x9e\x7e\x33\x9a\xec\x41\x69\x45\x22\xb8\xb4\x51\xeb\x04\x77\xca\x6f\x7b\x7b\xc8\xb2\xb0\x95\x92\x25\x5b\xd0\x42\xaa\x2a\xdd\x32\x78\x4f\x0c\xab\x68\x46\x6c\xea\x6d\xf4\x5c\x5e\xde\xc4\xac\xa5\xf9\xd1\x00\x9f\x7d\x98\x65\x24\xbd\xc7\x97\xd4\xb3\x3a\xa8\x2b\xa0\x34\x76\xf9\x65\x5f\x2d\x25\x95\x1b\xcf\xd6\xf4\x9b\x5f\x09\x95\xb0\x36\x3f\xdb\xd0\x39\x2a\x93\x1c\x9d\x03\xa2\x4a\xca\xf5\xf6\x10\xb6\x94\x89\x0b\x6a\x70\x12\x13\x49\x6e\x40\xe4\x29\x12\x2b\xbd\x80\x45\x11\x04\xaa\xc2\x8f\x56\x9e\x5c\x6b\xec\x8d\x5a\x0e\x14\x59\x06\x2b\x1e\x24\xcb\xc2\x56\x4a\x31\xbe\x23\x71\x1a\xfb\x51\x2a\x0b\x3b\x1c\x48\x10\xa5\x82\xdc\xc0\xbb\x3e\x24\x8d\x5a\x76\x2e\x09\xed\xc1\x65\x51\xb8\x83\xcb\x3e\x24\x8d\x5a\x2e\x5d\xfe\x02\x74\x2d\x3d\xf1\xef\xae\xb8\x4b\xe6\x5e\xd4\xaa\xe2\x2e\x5c\x5e\xec\x0e\xf5\x5b\x0c\xcb\x0a\xbb\xa4\x3c\xf7\x1f\x2a\x55\x69\x97\x8c\x7d\x68\x95\xa5\xad\xb4\xf4\x9c\xa5\x07\xb9\x7a\x05\xbb\xad\x50\x6f\xfb\xa0\x4e\x9b\x48\x23\x49\x92\x28\x87\x19\x3e\x32\xee\xca\x3b\x46\x7e\x7f\x18\x64\xcc\xcc\x0f\x34\xe9\x36\x8b\xb7\x6c\xa8\xa5\x5b\x54\x4c\x54\x5b\x15\x3a\xf1\x6c\x2d\xfe\x96\xc8\x0d\xba\x7b\x81\x88\xc8\x23\xab\xee\x7d\x3b\x92\xa7\x60\x29\xe3\xdc\xff\xb8\x64\xe1\xf6\xa2\x5a\x59\xdc\x6f\xeb\x45\x7d\x6a\xd1\x76\x1e\xea\xb8\xf1\xfa\x14\xd3\x36\x63\xe5\xd7\xf3\xe4\xbe\x25\xbd\x5e\x05\xeb\x73\x74\xb5\x21\x2a\x2e\x4e\xa3\x30\xdf\xbf\x43\x28\x2a\xd1\xa5\x2a\x9d\x8a\xfd\x76\xd8\x8d\xbc\x67\x65\xc7\xb8\x03\x45\xec\xa3\xb0\x37\x8a\x70\x4c\x68\x91\x51\x8e\x58\x80\xed\x4a\xf3\x81\x62\xca\x96\xbb\xf1\x52\xcd\x80\xfb\xe4\x4a\x5d\x6c\xdf\x6e\x20\x4b\x80\x30\x8e\x28\x93\xf9\xe9\x8d\x8a\x6d\xd5\x59\x65\x7b\xaa\x44\x9e\xc0\xc2\xd1\x7c\x40\x26\xd6\x1a\xce\xf9\xc5\x69\x7b\x6c\xec\xc8\x71\x7b\xe5\x21\x2e\xd3\xe5\x65\x93\x91\x53\x0b\x7b\x3a\xc7\xfa\x17\x6a\x01\xa7\x33\xd0\xf4\x40\x0f\x39\x87\xda\xe4\x54\x87\x3a\xd5\xe3\xc7\xa6\x8e\x20\xd4\x11\xb2\x4e\xb1\xe9\x14\x9b\x4e\xb1\xe9\x14\x9b\xfe\x15\x63\xd3\x47\xf5\xff\x97\x38\xe9\xcf\x14\xf8\x76\x82\x49\x13\x4c\xaa\x7d\xcd\x6c\x62\x42\x49\x87\x43\x49\x19\x33\x6f\xe3\x44\x6e\x9b\xab\x8a\x3e\x86\xaa\x99\x52\x1b\x5b\x59\x33\x02\x09\xa0\x21\xa1\x6b\x84\x6b\x66\xbb\xdc\x16\x0c\xd3\x68\xab\xec\x36\x4b\xd8\x60\x8a\x40\x31\x85\x6e\x14\x57\x13\xc2\xfb\x92\x10\xde\xbf\x88\xdc\xbc\x53\x5e\x7f\x82\x7a\x13\xd4\x9b\xa0\xde\x04\xf5\x90\x01\xf5\x94\xcb\x7b\x83\x25\x9e\xd0\xde\x84\xf6\x6a\x5f\x4b\xb3\x98\x00\xdf\x04\xf8\x6c\xbc\x7f\x19\x80\xaf\xf1\x71\x45\x22\x98\x40\xe0\x04\x02\x27\x10\xd8\x29\xf5\x04\x02\xff\x4a\x20\x30\xc1\x72\xf3\x65\x02\x40\xd7\xc1\xd1\xe2\x6b\xf1\xa9\x7b\xfb\xe4\x20\xc0\x68\x9d\xd4\xb4\xd3\x96\xb5\xa6\xd1\x41\x20\xe6\x89\xc3\x48\x65\x58\x13\x84\x9c\x56\x56\x3b\x0c\xe0\x6b\x83\x5c\x13\xd2\x9a\x90\xd6\x84\xb4\x26\xa4\x85\x0c\xa4\x45\x19\xfd\xff\x63\x6c\x52\xb5\x1f\x1e\x19\x74\x3a\xcd\xb9\x69\xce\xa6\x3a\x0f\x7a\x2d\x19\xc7\x81\x14\x5d\xcb\xd5\x03\xc9\x39\xd0\xb0\xd1\xb3\xcd\xfb\x7a\x2d\x5d\x3a\x48\xe1\xfa\x2e\xe6\x81\x42\x18\x86\xd6\xc1\xbe\xb1\x23\xd3\xf7\x34\xed\x19\x0a\x0b\xc4\x48\x44\xfd\x22\x50\xb6\x42\x58\xbb\xe5\x3d\xa7\x73\xd4\x8b\xc4\x8c\x70\x61\xec\x73\xee\xc3\x81\x8b\xf5\xe2\xd7\x52\x3e\xcf\xeb\xeb\x17\x3b\x71\x16\xda\x7d\xb8\xde\xf0\x7a\x8f\x06\x2d\xa7\x40\x7b\xc1\x9d\x41\x4d\xb6\x61\xa2\x4e\x9f\x3d\xa0\xc5\xae\xe3\x1c\x1d\x40\x6c\x48\x8b\x63\xa0\xb5\x01\xed\x8e\x02\xe9\x86\xc8\x3b\x06\xee\xdb\x4b\xde\xbd\xc0\xa1\x6f\xcb\xda\xfc\xc2\x44\x16\x87\x9c\x17\x31\xd3\x30\x20\x39\x42\xcb\x6f\xf2\xf1\xf4\x72\x10\xf8\x1c\xa0\xf3\xbd\x10\xea\x21\x35\x7d\xe8\x86\xdb\x15\xed\x81\x81\x07\x28\xbb\x13\x28\xc7\xf8\xce\x7d\x8d\xc2\x31\xb4\x7e\x94\xd6\xdb\x55\xef\x4a\xfb\xed\xc3\x40\x3e\xeb\x9f\xe9\x99\x0f\xdf\x08\x65\x88\x27\x73\x86\x31\x9d\x47\xdf\x55\x19\xba\x3d\xee\x15\x0a\xcd\x8c\xaa\x5e\xb9\xf6\x57\x33\x73\x5a\xa1\x89\x7b\x3b\xa0\xb2\xa4\xc2\xf6\xc1\x53\xb5\x00\xca\x23\xe5\xf4\x60\x6a\xb4\x2d\x74\xea\x4e\xed\x3b\xe3\x47\xfb\xed\x82\x3d\x19\xd4\x3b\x6b\xaf\xae\x2b\x2f\x57\xb3\x82\x68\xcb\xed\x88\x2e\xe1\x5c\xd7\x26\xfa\x0a\x65\xe7\xce\x11\x33\xb4\xdd\x66\xe3\x37\xf6\xfa\x70\xd6\x4f\xa1\x21\x51\xd8\x3c\x26\x14\x4b\xc6\x87\x44\x27\x1c\x70\xf8\x9e\x46\xce\xab\x21\x07\x5f\xc1\x76\x17\x1b\x77\xb4\xda\x75\xa0\x0a\x3a\x30\xe1\xf8\x97\x32\x16\x2b\x00\x75\x85\xee\x62\x46\xef\xd3\x85\xb5\x6b\x60\xbe\xf2\x30\x7a\x8c\x0b\x4b\xa6\xd0\xf9\x64\x42\xe7\x07\x41\x41\xe3\x2c\x5d\xf9\x6d\xe9\x39\x98\x3b\x3b\x5d\x67\xd4\x5c\xed\xf2\xf0\x48\x7b\xbd\x2d\x31\xdd\x3f\x34\xad\x44\x76\x51\x9a\x56\x22\xa7\x95\xc8\x69\x25\xf2\xe1\x56\x22\x1f\x00\x32\x6a\x73\x92\xed\xe1\xc6\x7d\x9f\x49\x2c\x69\x7e\xc8\x31\x4c\x0c\xb4\xf2\x54\x3b\x79\x3b\x9e\x4d\xb4\xd1\x18\x3e\x5f\x9a\x93\xa2\x11\xc3\xda\x27\x0b\xaf\x37\x2e\x5c\x37\xfb\xeb\x9a\xd6\xc3\xac\xc3\xcc\xf8\x1e\x5b\x9d\xac\x22\x64\xb7\xed\x26\xb8\xf3\xb9\x3c\xbb\x1f\xe2\xb0\x22\x77\x43\x6a\x62\x29\x39\x59\xa6\xe6\xe5\xcd\x7b\x83\xc0\x5b\x8e\x93\x64\xac\xeb\xca\x4f\x65\xac\x4a\xbc\x1e\xcd\x82\xfa\x3c\x70\x36\xb6\xb5\xed\x79\xef\xec\x68\x00\xff\x54\xfa\xb5\xe3\xf1\xdb\xe1\xbe\xce\x76\x17\xaf\x57\xb6\x6b\x89\x05\x09\xce\x52\xb9\x01\x2a\x49\xbe\xd9\xf4\xd2\xb8\x7a\xbf\x91\x02\xf3\x22\x8c\x13\xf2\x77\xd8\x8e\x43\x8b\xe1\x54\x6e\x5e\x9d\xc7\x49\x44\x02\x22\xc7\xa4\x79\x81\x85\xb8\x65\x3c\x1c\x93\xe6\x59\xa2\xf8\x1c\x51\x95\x05\xd9\x20\x00\x21\x7e\x60\x21\x58\xa9\x56\xff\xbe\xb6\x5a\x5e\x5b\x3f\x1f\xd6\xd3\x3c\xc4\x4d\xba\x99\xb4\x63\x6e\x7d\x3e\x3d\x57\xd2\x18\x5f\x47\xe8\xc3\x06\x8a\x68\x6c\x7f\x3b\x72\x0f\xe7\xe2\x77\x77\xf1\xd0\x99\xab\xdf\x2e\xfe\xd6\xbb\xcd\x1a\xb9\x90\xd1\xaf\xf2\x38\x3d\xdb\x74\xf8\xeb\xe3\xda\xe8\x2a\x62\xb7\xda\x1b\x07\xa9\xdc\x30\x5e\xbc\x68\xfb\x6b\x9f\x97\xf1\xc6\xb1\xd8\x5c\x29\x1e\x49\x30\xc5\xf7\xde\xad\x91\x42\xf9\xdd\xed\x89\x80\x25\xbe\x37\xd7\xe7\x32\x5c\xe6\x35\xac\xd4\x0c\x2d\xf7\x90\xc4\xe3\xf5\xe3\x2f\x7f\x54\x18\x88\xe3\x61\x47\x85\x64\x7f\xc0\xd7\x3f\x1a\x92\x42\xe9\xc7\x1e\x0d\x95\x76\xa7\x51\xa0\x8f\x02\x1b\x46\x9e\x06\x42\xd1\xf2\x01\x07\x02\xde\xe9\x7d\x1a\x0b\xa7\x32\x16\xcc\xc0\xee\xc4\x90\xd2\x5f\x6f\x98\x54\x5d\xf2\x95\xe1\xa7\x69\x10\x3a\x06\xe1\x65\xb3\x17\x47\x58\x78\xd0\x45\xd6\x5b\xd5\x5f\x25\x1d\x71\x49\xa6\x7a\x64\xda\xd0\x6f\xc7\x3a\x4c\xe3\x09\xc0\x6e\x96\x2c\xa7\xa7\x77\x34\x10\x05\x08\x21\x44\x92\x65\x77\xdf\x20\x5c\xbc\xe7\x97\x3f\xf4\x1a\x45\xd6\xe7\x27\x4a\xde\x74\x27\x66\x11\x7d\x70\xba\xd3\x78\xf9\x1e\x0d\xca\xc8\x39\xde\x7c\xb3\xa6\xe1\xbc\xd7\xc1\x6a\x6f\xb3\x0e\x52\xbe\xe4\x98\x8a\x15\x70\x94\x70\x26\x59\xc0\xa2\xf2\x1c\xfb\xd9\xc5\xf9\xbc\xd5\x92\x9c\xa3\xdf\xe6\x1e\xb3\x0d\x49\xba\x87\x50\x5f\x84\xfe\xe9\xd6\xf8\xbb\xe6\xf0\x7a\xeb\xa6\x65\x3b\x86\x8b\x79\x93\xf5\x59\x20\x6e\xb4\xa7\x44\xf4\x3f\xa5\xfe\x67\x42\x12\xdb\xd3\xe7\xbb\xa5\xa3\x8c\x5c\x2b\x97\xbb\xbb\x7f\x8e\xc5\x6e\xed\x43\x5c\xbf\x74\xc8\x8f\xff\xe6\xd6\xbe\x91\xb6\xf5\x95\xe4\xed\x93\xc4\xa8\x5b\xf9\x76\x4d\x35\xb7\xd8\x8c\xb6\x7d\xaf\x72\xe0\xb6\xbd\x01\x63\x9e\x76\xab\x1a\x32\x76\xe4\x8c\x76\xc2\xad\x6c\xa2\x65\xf7\xcf\xf8\xa7\xda\x2a\xb9\x8c\x3d\x3c\xa3\x9d\x64\x33\xe5\x1a\xb5\x2d\xfb\x86\xa2\x5a\x7f\x19\x5b\x7f\xc6\x3f\xd1\x53\xd3\xe2\x41\x5b\xd3\x4f\xf0\xec\xb0\x42\x73\x43\xd2\x68\x27\xd3\x6a\x6a\x34\xf6\x4e\x1e\x52\x8b\x87\x6c\xcc\xae\x44\xfb\x9e\xa7\x51\x4f\x9d\x55\x03\x81\x8e\x67\xfc\xb4\x69\xf0\x3a\x18\xf2\x40\xd0\xf6\xa8\x34\xe3\xc9\x98\xaf\xf6\xda\x24\xd3\xeb\x60\xb9\x0e\xd3\x1f\xa9\xff\xee\x1f\xfd\x37\x00\x00\xff\xff\x69\x5d\x0a\x6a\x39\x9d\x00\x00") - -func v2SchemaJSONBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJSON, - "v2/schema.json", - ) -} - -func v2SchemaJSON() (*asset, error) { - bytes, err := v2SchemaJSONBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(420), modTime: time.Unix(1482389892, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04JSON, - "v2/schema.json": v2SchemaJSON, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": &bintree{jsonschemaDraft04JSON, map[string]*bintree{}}, - "v2": &bintree{nil, map[string]*bintree{ - "schema.json": &bintree{v2SchemaJSON, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} - diff --git a/cmd/vendor/github.com/go-openapi/spec/contact_info.go b/cmd/vendor/github.com/go-openapi/spec/contact_info.go deleted file mode 100644 index f285970aa1..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/contact_info.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// ContactInfo contact information for the exposed API. -// -// For more information: http://goo.gl/8us55a#contactObject -type ContactInfo struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Email string `json:"email,omitempty"` -} diff --git a/cmd/vendor/github.com/go-openapi/spec/expander.go b/cmd/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index 5054a7be67..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,992 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "os" - "path" - "path/filepath" - "reflect" - "strings" - "sync" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -var ( - // Debug enables logging when SWAGGER_DEBUG env var is not empty - Debug = os.Getenv("SWAGGER_DEBUG") != "" -) - -// ExpandOptions provides options for expand. -type ExpandOptions struct { - RelativeBase string - SkipSchemas bool - ContinueOnError bool -} - -// ResolutionCache a cache for resolving urls -type ResolutionCache interface { - Get(string) (interface{}, bool) - Set(string, interface{}) -} - -type simpleCache struct { - lock sync.Mutex - store map[string]interface{} -} - -var resCache ResolutionCache - -func init() { - resCache = initResolutionCache() -} - -func initResolutionCache() ResolutionCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} - -func (s *simpleCache) Get(uri string) (interface{}, bool) { - debugLog("getting %q from resolution cache", uri) - s.lock.Lock() - v, ok := s.store[uri] - debugLog("got %q from resolution cache: %t", uri, ok) - - s.lock.Unlock() - return v, ok -} - -func (s *simpleCache) Set(uri string, data interface{}) { - s.lock.Lock() - s.store[uri] = data - s.lock.Unlock() -} - -// ResolveRefWithBase resolves a reference against a context root with preservation of base path -func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions) (*Schema, error) { - resolver, err := defaultSchemaLoader(root, opts, nil) - if err != nil { - return nil, err - } - specBasePath := "" - if opts != nil && opts.RelativeBase != "" { - specBasePath, _ = absPath(opts.RelativeBase) - } - - result := new(Schema) - if err := resolver.Resolve(ref, result, specBasePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolveRef resolves a reference against a context root -// ref is guaranteed to be in root (no need to go to external files) -// ResolveRef is ONLY called from the code generation module -func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { - res, _, err := ref.GetPointer().Get(root) - if err != nil { - panic(err) - } - switch sch := res.(type) { - case Schema: - return &sch, nil - case *Schema: - return sch, nil - case map[string]interface{}: - b, _ := json.Marshal(sch) - newSch := new(Schema) - json.Unmarshal(b, newSch) - return newSch, nil - default: - return nil, fmt.Errorf("unknown type for the resolved reference") - } -} - -// ResolveParameter resolves a paramter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveParameterWithBase resolves a paramter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Parameter, error) { - resolver, err := defaultSchemaLoader(root, opts, nil) - if err != nil { - return nil, err - } - - result := new(Parameter) - if err := resolver.Resolve(&ref, result, ""); err != nil { - return nil, err - } - return result, nil -} - -// ResolveResponse resolves response a reference against a context root -func ResolveResponse(root interface{}, ref Ref) (*Response, error) { - return ResolveResponseWithBase(root, ref, nil) -} - -// ResolveResponseWithBase resolves response a reference against a context root and base path -func ResolveResponseWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Response, error) { - resolver, err := defaultSchemaLoader(root, opts, nil) - if err != nil { - return nil, err - } - - result := new(Response) - if err := resolver.Resolve(&ref, result, ""); err != nil { - return nil, err - } - return result, nil -} - -// ResolveItems resolves header and parameter items reference against a context root and base path -func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Items, error) { - resolver, err := defaultSchemaLoader(root, opts, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(Items) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolvePathItem resolves response a path item against a context root and base path -func ResolvePathItem(root interface{}, ref Ref, opts *ExpandOptions) (*PathItem, error) { - resolver, err := defaultSchemaLoader(root, opts, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(PathItem) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - loadDoc func(string) (json.RawMessage, error) -} - -var idPtr, _ = jsonpointer.New("/id") -var refPtr, _ = jsonpointer.New("/$ref") - -// PathLoader function to use when loading remote refs -var PathLoader func(string) (json.RawMessage, error) - -func init() { - PathLoader = func(path string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil - } -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache) (*schemaLoader, error) { - - if cache == nil { - cache = resCache - } - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - loadDoc: func(path string) (json.RawMessage, error) { - debugLog("fetching document at %q", path) - return PathLoader(path) - }, - }, nil -} - -func idFromNode(node interface{}) (*Ref, error) { - if idValue, _, err := idPtr.Get(node); err == nil { - if refStr, ok := idValue.(string); ok && refStr != "" { - idRef, err := NewRef(refStr) - if err != nil { - return nil, err - } - return &idRef, nil - } - } - return nil, nil -} - -func nextRef(startingNode interface{}, startingRef *Ref, ptr *jsonpointer.Pointer) *Ref { - if startingRef == nil { - return nil - } - - if ptr == nil { - return startingRef - } - - ret := startingRef - var idRef *Ref - node := startingNode - - for _, tok := range ptr.DecodedTokens() { - node, _, _ = jsonpointer.GetForToken(node, tok) - if node == nil { - break - } - - idRef, _ = idFromNode(node) - if idRef != nil { - nw, err := ret.Inherits(*idRef) - if err != nil { - break - } - ret = nw - } - - refRef, _, _ := refPtr.Get(node) - if refRef != nil { - var rf Ref - switch value := refRef.(type) { - case string: - rf, _ = NewRef(value) - } - nw, err := ret.Inherits(rf) - if err != nil { - break - } - nwURL := nw.GetURL() - if nwURL.Scheme == "file" || (nwURL.Scheme == "" && nwURL.Host == "") { - nwpt := filepath.ToSlash(nwURL.Path) - if filepath.IsAbs(nwpt) { - _, err := os.Stat(nwpt) - if err != nil { - nwURL.Path = filepath.Join(".", nwpt) - } - } - } - - ret = nw - } - - } - - return ret -} - -func debugLog(msg string, args ...interface{}) { - if Debug { - log.Printf(msg, args...) - } -} - -// normalize absolute path for cache. -// on Windows, drive letters should be converted to lower as scheme in net/url.URL -func normalizeAbsPath(path string) string { - u, err := url.Parse(path) - if err != nil { - debugLog("normalize absolute path failed: %s", err) - return path - } - return u.String() -} - -// base or refPath could be a file path or a URL -// given a base absolute path and a ref path, return the absolute path of refPath -// 1) if refPath is absolute, return it -// 2) if refPath is relative, join it with basePath keeping the scheme, hosts, and ports if exists -// base could be a directory or a full file path -func normalizePaths(refPath, base string) string { - refURL, _ := url.Parse(refPath) - if path.IsAbs(refURL.Path) { - // refPath is actually absolute - if refURL.Host != "" { - return refPath - } - return filepath.FromSlash(refPath) - } - - // relative refPath - baseURL, _ := url.Parse(base) - if !strings.HasPrefix(refPath, "#") { - // combining paths - if baseURL.Host != "" { - baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) - } else { // base is a file - newBase := fmt.Sprintf("%s#%s", filepath.Join(filepath.Dir(base), filepath.FromSlash(refURL.Path)), refURL.Fragment) - return newBase - } - - } - // copying fragment from ref to base - baseURL.Fragment = refURL.Fragment - return baseURL.String() -} - -// relativeBase could be an ABSOLUTE file path or an ABSOLUTE URL -func normalizeFileRef(ref *Ref, relativeBase string) *Ref { - // This is important for when the reference is pointing to the root schema - if ref.String() == "" { - r, _ := NewRef(relativeBase) - return &r - } - - refURL := ref.GetURL() - debugLog("normalizing %s against %s (%s)", ref.String(), relativeBase, refURL.String()) - - s := normalizePaths(ref.String(), relativeBase) - r, _ := NewRef(s) - return &r -} - -func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { - tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { - return fmt.Errorf("resolve ref: target needs to be a pointer") - } - - refURL := ref.GetURL() - if refURL == nil { - return nil - } - - var res interface{} - var data interface{} - var err error - // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means - // it is pointing somewhere in the root. - root := r.root - if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { - if baseRef, err := NewRef(basePath); err == nil { - root, _, _, _ = r.load(baseRef.GetURL()) - } - } - if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { - data = root - } else { - baseRef := normalizeFileRef(ref, basePath) - debugLog("current ref is: %s", ref.String()) - debugLog("current ref normalized file: %s", baseRef.String()) - data, _, _, err = r.load(baseRef.GetURL()) - if err != nil { - return err - } - } - - res = data - if ref.String() != "" { - res, _, err = ref.GetPointer().Get(data) - if err != nil { - return err - } - } - if err := swag.DynamicJSONToStruct(res, target); err != nil { - return err - } - - return nil -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - data, fromCache := r.cache.Get(toFetch.String()) - if !fromCache { - b, err := r.loadDoc(toFetch.String()) - if err != nil { - return nil, url.URL{}, false, err - } - - if err := json.Unmarshal(b, &data); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(toFetch.String(), data) - } - - return data, toFetch, fromCache, nil -} - -// Resolve resolves a reference against basePath and stores the result in target -// Resolve is not in charge of following references, it only resolves ref by following its URL -// if the schema that ref is referring to has more refs in it. Resolve doesn't resolve them -// if basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct -func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { - return r.resolveRef(ref, target, basePath) -} - -// absPath returns the absolute path of a file -func absPath(fname string) (string, error) { - if strings.HasPrefix(fname, "http") { - return fname, nil - } - if filepath.IsAbs(fname) { - return fname, nil - } - wd, err := os.Getwd() - return filepath.Join(wd, fname), err -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - resolver, err := defaultSchemaLoader(spec, options, nil) - // Just in case this ever returns an error. - if shouldStopOnError(err, resolver.options) { - return err - } - - // getting the base path of the spec to adjust all subsequent reference resolutions - specBasePath := "" - if options != nil && options.RelativeBase != "" { - specBasePath, _ = absPath(options.RelativeBase) - } - - if options == nil || !options.SkipSchemas { - for key, definition := range spec.Definitions { - var def *Schema - var err error - if def, err = expandSchema(definition, []string{fmt.Sprintf("#/defintions/%s", key)}, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key, parameter := range spec.Parameters { - if err := expandParameter(¶meter, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Parameters[key] = parameter - } - - for key, response := range spec.Responses { - if err := expandResponse(&response, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key, path := range spec.Paths.Paths { - if err := expandPathItem(&path, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Paths.Paths[key] = path - } - } - - return nil -} - -func shouldStopOnError(err error, opts *ExpandOptions) bool { - if err != nil && !opts.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -// ExpandSchema expands the refs in the schema object with reference to the root object -// go-openapi/validate uses this function -// notice that it is impossible to reference a json scema in a different file other than root -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - // Only save the root to a tmp file if it isn't nil. - var base string - if root != nil { - base, _ = absPath("root") - if cache == nil { - cache = resCache - } - cache.Set(normalizeAbsPath(base), root) - base = "root" - } - - opts := &ExpandOptions{ - RelativeBase: base, - SkipSchemas: false, - ContinueOnError: false, - } - return ExpandSchemaWithBasePath(schema, cache, opts) -} - -// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options -func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { - if schema == nil { - return nil - } - - var basePath string - if opts.RelativeBase != "" { - basePath, _ = absPath(opts.RelativeBase) - } - - resolver, err := defaultSchemaLoader(nil, opts, cache) - if err != nil { - return err - } - - refs := []string{""} - var s *Schema - if s, err = expandSchema(*schema, refs, resolver, basePath); err != nil { - return err - } - *schema = *s - return nil -} - -func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Items != nil { - if target.Items.Schema != nil { - t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - *target.Items.Schema = *t - } - for i := range target.Items.Schemas { - t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - target.Items.Schemas[i] = *t - } - } - return &target, nil -} - -// basePathFromSchemaID returns a new basePath based on an existing basePath and a schema ID -func basePathFromSchemaID(oldBasePath, id string) string { - u, err := url.Parse(oldBasePath) - if err != nil { - panic(err) - } - uid, err := url.Parse(id) - if err != nil { - panic(err) - } - - if path.IsAbs(uid.Path) { - return id - } - u.Path = path.Join(path.Dir(u.Path), uid.Path) - return u.String() -} - -func isCircular(ref *Ref, basePath string, parentRefs ...string) bool { - return basePath != "" && swag.ContainsStringsCI(parentRefs, ref.String()) -} - -func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Ref.String() == "" && target.Ref.IsRoot() { - // normalizing is important - newRef := normalizeFileRef(&target.Ref, basePath) - target.Ref = *newRef - return &target, nil - - } - - /* change the base path of resolution when an ID is encountered - otherwise the basePath should inherit the parent's */ - // important: ID can be relative path - if target.ID != "" { - // handling the case when id is a folder - // remember that basePath has to be a file - refPath := target.ID - if strings.HasSuffix(target.ID, "/") { - // path.Clean here would not work correctly if basepath is http - refPath = fmt.Sprintf("%s%s", refPath, "placeholder.json") - } - basePath = normalizePaths(refPath, basePath) - } - - /* Explain here what this function does */ - - var t *Schema - /* if Ref is found, everything else doesn't matter */ - /* Ref also changes the resolution scope of children expandSchema */ - if target.Ref.String() != "" { - /* Here the resolution scope is changed because a $ref was encountered */ - normalizedRef := normalizeFileRef(&target.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - /* this means there is a circle in the recursion tree */ - /* return the Ref */ - if isCircular(normalizedRef, basePath, parentRefs...) { - target.Ref = *normalizedRef - return &target, nil - } - - debugLog("\nbasePath: %s", basePath) - if Debug { - b, _ := json.Marshal(target) - debugLog("calling Resolve with target: %s", string(b)) - } - if err := resolver.Resolve(&target.Ref, &t, basePath); shouldStopOnError(err, resolver.options) { - return nil, err - } - - if t != nil { - parentRefs = append(parentRefs, normalizedRef.String()) - return expandSchema(*t, parentRefs, resolver, normalizedBasePath) - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - target.AllOf[i] = *t - } - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - target.AnyOf[i] = *t - } - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.Properties[k] = *t - } - } - if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { - t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.AdditionalProperties.Schema = *t - } - } - for k := range target.PatternProperties { - t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.PatternProperties[k] = *t - } - } - for k := range target.Dependencies { - if target.Dependencies[k].Schema != nil { - t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.Dependencies[k].Schema = *t - } - } - } - if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { - t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - for k := range target.Definitions { - t, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.Definitions[k] = *t - } - } - return &target, nil -} - -func derefPathItem(pathItem *PathItem, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := pathItem.Ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(&pathItem.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(&pathItem.Ref, pathItem, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if pathItem.Ref.String() != "" && pathItem.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefPathItem(pathItem, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := []string{} - if err := derefPathItem(pathItem, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - pathItem.Ref = Ref{} - - parentRefs = parentRefs[0:] - - for idx := range pathItem.Parameters { - if err := expandParameter(&(pathItem.Parameters[idx]), resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - } - if err := expandOperation(pathItem.Get, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Head, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Options, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Put, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Post, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Patch, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Delete, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i, param := range op.Parameters { - if err := expandParameter(¶m, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - op.Parameters[i] = param - } - - if op.Responses != nil { - responses := op.Responses - if err := expandResponse(responses.Default, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - for code, response := range responses.StatusCodeResponses { - if err := expandResponse(&response, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - responses.StatusCodeResponses[code] = response - } - } - return nil -} - -// ExpandResponse expands a response based on a basepath -// This is the exported version of expandResponse -// all refs inside response will be resolved relative to basePath -func ExpandResponse(response *Response, basePath string) error { - opts := &ExpandOptions{ - RelativeBase: basePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil) - if err != nil { - return err - } - - return expandResponse(response, resolver, basePath) -} - -func derefResponse(response *Response, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := response.Ref.String() - if curRef != "" { - /* Here the resolution scope is changed because a $ref was encountered */ - normalizedRef := normalizeFileRef(&response.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(&response.Ref, response, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if response.Ref.String() != "" && response.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefResponse(response, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandResponse(response *Response, resolver *schemaLoader, basePath string) error { - if response == nil { - return nil - } - - parentRefs := []string{} - if err := derefResponse(response, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - response.Ref = Ref{} - - parentRefs = parentRefs[0:] - if !resolver.options.SkipSchemas && response.Schema != nil { - parentRefs = append(parentRefs, response.Schema.Ref.String()) - s, err := expandSchema(*response.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return err - } - *response.Schema = *s - } - - return nil -} - -// ExpandParameter expands a parameter based on a basepath -// This is the exported version of expandParameter -// all refs inside parameter will be resolved relative to basePath -func ExpandParameter(parameter *Parameter, basePath string) error { - opts := &ExpandOptions{ - RelativeBase: basePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil) - if err != nil { - return err - } - - return expandParameter(parameter, resolver, basePath) -} - -func derefParameter(parameter *Parameter, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := parameter.Ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(¶meter.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(¶meter.Ref, parameter, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if parameter.Ref.String() != "" && parameter.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefParameter(parameter, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandParameter(parameter *Parameter, resolver *schemaLoader, basePath string) error { - if parameter == nil { - return nil - } - - parentRefs := []string{} - if err := derefParameter(parameter, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - parameter.Ref = Ref{} - - parentRefs = parentRefs[0:] - if !resolver.options.SkipSchemas && parameter.Schema != nil { - parentRefs = append(parentRefs, parameter.Schema.Ref.String()) - s, err := expandSchema(*parameter.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return err - } - *parameter.Schema = *s - } - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/external_docs.go b/cmd/vendor/github.com/go-openapi/spec/external_docs.go deleted file mode 100644 index 88add91b2b..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/external_docs.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// ExternalDocumentation allows referencing an external resource for -// extended documentation. -// -// For more information: http://goo.gl/8us55a#externalDocumentationObject -type ExternalDocumentation struct { - Description string `json:"description,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/cmd/vendor/github.com/go-openapi/spec/header.go b/cmd/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 85c4d454c1..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -type HeaderProps struct { - Description string `json:"description,omitempty"` -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - CommonValidations - SimpleSchema - VendorExtensible - HeaderProps -} - -// ResponseHeader creates a new header instance for use in a response -func ResponseHeader() *Header { - return new(Header) -} - -// WithDescription sets the description on this response, allows for chaining -func (h *Header) WithDescription(description string) *Header { - h.Description = description - return h -} - -// Typed a fluent builder method for the type of parameter -func (h *Header) Typed(tpe, format string) *Header { - h.Type = tpe - h.Format = format - return h -} - -// CollectionOf a fluent builder method for an array item -func (h *Header) CollectionOf(items *Items, format string) *Header { - h.Type = "array" - h.Items = items - h.CollectionFormat = format - return h -} - -// WithDefault sets the default value on this item -func (h *Header) WithDefault(defaultValue interface{}) *Header { - h.Default = defaultValue - return h -} - -// WithMaxLength sets a max length value -func (h *Header) WithMaxLength(max int64) *Header { - h.MaxLength = &max - return h -} - -// WithMinLength sets a min length value -func (h *Header) WithMinLength(min int64) *Header { - h.MinLength = &min - return h -} - -// WithPattern sets a pattern value -func (h *Header) WithPattern(pattern string) *Header { - h.Pattern = pattern - return h -} - -// WithMultipleOf sets a multiple of value -func (h *Header) WithMultipleOf(number float64) *Header { - h.MultipleOf = &number - return h -} - -// WithMaximum sets a maximum number value -func (h *Header) WithMaximum(max float64, exclusive bool) *Header { - h.Maximum = &max - h.ExclusiveMaximum = exclusive - return h -} - -// WithMinimum sets a minimum number value -func (h *Header) WithMinimum(min float64, exclusive bool) *Header { - h.Minimum = &min - h.ExclusiveMinimum = exclusive - return h -} - -// WithEnum sets a the enum values (replace) -func (h *Header) WithEnum(values ...interface{}) *Header { - h.Enum = append([]interface{}{}, values...) - return h -} - -// WithMaxItems sets the max items -func (h *Header) WithMaxItems(size int64) *Header { - h.MaxItems = &size - return h -} - -// WithMinItems sets the min items -func (h *Header) WithMinItems(size int64) *Header { - h.MinItems = &size - return h -} - -// UniqueValues dictates that this array can only have unique items -func (h *Header) UniqueValues() *Header { - h.UniqueItems = true - return h -} - -// AllowDuplicates this array can have duplicates -func (h *Header) AllowDuplicates() *Header { - h.UniqueItems = false - return h -} - -// MarshalJSON marshal this to JSON -func (h Header) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(h.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(h.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(h.HeaderProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// UnmarshalJSON marshal this from JSON -func (h *Header) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &h.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { - return err - } - if err := json.Unmarshal(data, &h.HeaderProps); err != nil { - return err - } - return nil -} - -// JSONLookup look up a value by the json property name -func (p Header) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.HeaderProps, token) - return r, err -} diff --git a/cmd/vendor/github.com/go-openapi/spec/info.go b/cmd/vendor/github.com/go-openapi/spec/info.go deleted file mode 100644 index fb8b7c4ac5..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/info.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Extensions vendor specific extensions -type Extensions map[string]interface{} - -// Add adds a value to these extensions -func (e Extensions) Add(key string, value interface{}) { - realKey := strings.ToLower(key) - e[realKey] = value -} - -// GetString gets a string value from the extensions -func (e Extensions) GetString(key string) (string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(string) - return str, ok - } - return "", false -} - -// GetBool gets a string value from the extensions -func (e Extensions) GetBool(key string) (bool, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(bool) - return str, ok - } - return false, false -} - -// GetStringSlice gets a string value from the extensions -func (e Extensions) GetStringSlice(key string) ([]string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - arr, ok := v.([]interface{}) - if !ok { - return nil, false - } - var strs []string - for _, iface := range arr { - str, ok := iface.(string) - if !ok { - return nil, false - } - strs = append(strs, str) - } - return strs, ok - } - return nil, false -} - -// VendorExtensible composition block. -type VendorExtensible struct { - Extensions Extensions -} - -// AddExtension adds an extension to this extensible object -func (v *VendorExtensible) AddExtension(key string, value interface{}) { - if value == nil { - return - } - if v.Extensions == nil { - v.Extensions = make(map[string]interface{}) - } - v.Extensions.Add(key, value) -} - -// MarshalJSON marshals the extensions to json -func (v VendorExtensible) MarshalJSON() ([]byte, error) { - toser := make(map[string]interface{}) - for k, v := range v.Extensions { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - toser[k] = v - } - } - return json.Marshal(toser) -} - -// UnmarshalJSON for this extensible object -func (v *VendorExtensible) UnmarshalJSON(data []byte) error { - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if v.Extensions == nil { - v.Extensions = map[string]interface{}{} - } - v.Extensions[k] = vv - } - } - return nil -} - -// InfoProps the properties for an info definition -type InfoProps struct { - Description string `json:"description,omitempty"` - Title string `json:"title,omitempty"` - TermsOfService string `json:"termsOfService,omitempty"` - Contact *ContactInfo `json:"contact,omitempty"` - License *License `json:"license,omitempty"` - Version string `json:"version,omitempty"` -} - -// Info object provides metadata about the API. -// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. -// -// For more information: http://goo.gl/8us55a#infoObject -type Info struct { - VendorExtensible - InfoProps -} - -// JSONLookup look up a value by the json property name -func (i Info) JSONLookup(token string) (interface{}, error) { - if ex, ok := i.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(i.InfoProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (i Info) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.InfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (i *Info) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &i.InfoProps); err != nil { - return err - } - if err := json.Unmarshal(data, &i.VendorExtensible); err != nil { - return err - } - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/items.go b/cmd/vendor/github.com/go-openapi/spec/items.go deleted file mode 100644 index 492423ef7f..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/items.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -type SimpleSchema struct { - Type string `json:"type,omitempty"` - Format string `json:"format,omitempty"` - Items *Items `json:"items,omitempty"` - CollectionFormat string `json:"collectionFormat,omitempty"` - Default interface{} `json:"default,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -func (s *SimpleSchema) TypeName() string { - if s.Format != "" { - return s.Format - } - return s.Type -} - -func (s *SimpleSchema) ItemsTypeName() string { - if s.Items == nil { - return "" - } - return s.Items.TypeName() -} - -type CommonValidations struct { - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` -} - -// Items a limited subset of JSON-Schema's items object. -// It is used by parameter definitions that are not located in "body". -// -// For more information: http://goo.gl/8us55a#items-object -type Items struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible -} - -// NewItems creates a new instance of items -func NewItems() *Items { - return &Items{} -} - -// Typed a fluent builder method for the type of item -func (i *Items) Typed(tpe, format string) *Items { - i.Type = tpe - i.Format = format - return i -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = "array" - i.Items = items - i.CollectionFormat = format - return i -} - -// WithDefault sets the default value on this item -func (i *Items) WithDefault(defaultValue interface{}) *Items { - i.Default = defaultValue - return i -} - -// WithMaxLength sets a max length value -func (i *Items) WithMaxLength(max int64) *Items { - i.MaxLength = &max - return i -} - -// WithMinLength sets a min length value -func (i *Items) WithMinLength(min int64) *Items { - i.MinLength = &min - return i -} - -// WithPattern sets a pattern value -func (i *Items) WithPattern(pattern string) *Items { - i.Pattern = pattern - return i -} - -// WithMultipleOf sets a multiple of value -func (i *Items) WithMultipleOf(number float64) *Items { - i.MultipleOf = &number - return i -} - -// WithMaximum sets a maximum number value -func (i *Items) WithMaximum(max float64, exclusive bool) *Items { - i.Maximum = &max - i.ExclusiveMaximum = exclusive - return i -} - -// WithMinimum sets a minimum number value -func (i *Items) WithMinimum(min float64, exclusive bool) *Items { - i.Minimum = &min - i.ExclusiveMinimum = exclusive - return i -} - -// WithEnum sets a the enum values (replace) -func (i *Items) WithEnum(values ...interface{}) *Items { - i.Enum = append([]interface{}{}, values...) - return i -} - -// WithMaxItems sets the max items -func (i *Items) WithMaxItems(size int64) *Items { - i.MaxItems = &size - return i -} - -// WithMinItems sets the min items -func (i *Items) WithMinItems(size int64) *Items { - i.MinItems = &size - return i -} - -// UniqueValues dictates that this array can only have unique items -func (i *Items) UniqueValues() *Items { - i.UniqueItems = true - return i -} - -// AllowDuplicates this array can have duplicates -func (i *Items) AllowDuplicates() *Items { - i.UniqueItems = false - return i -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (i *Items) UnmarshalJSON(data []byte) error { - var validations CommonValidations - if err := json.Unmarshal(data, &validations); err != nil { - return err - } - var ref Refable - if err := json.Unmarshal(data, &ref); err != nil { - return err - } - var simpleSchema SimpleSchema - if err := json.Unmarshal(data, &simpleSchema); err != nil { - return err - } - var vendorExtensible VendorExtensible - if err := json.Unmarshal(data, &vendorExtensible); err != nil { - return err - } - i.Refable = ref - i.CommonValidations = validations - i.SimpleSchema = simpleSchema - i.VendorExtensible = vendorExtensible - return nil -} - -// MarshalJSON converts this items object to JSON -func (i Items) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(i.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b4, b3, b1, b2), nil -} - -// JSONLookup look up a value by the json property name -func (p Items) JSONLookup(token string) (interface{}, error) { - if token == "$ref" { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - return r, err -} diff --git a/cmd/vendor/github.com/go-openapi/spec/license.go b/cmd/vendor/github.com/go-openapi/spec/license.go deleted file mode 100644 index f20961b4fd..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/license.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// License information for the exposed API. -// -// For more information: http://goo.gl/8us55a#licenseObject -type License struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/cmd/vendor/github.com/go-openapi/spec/operation.go b/cmd/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index e698f9e8ac..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - ID string `json:"operationId,omitempty"` - Deprecated bool `json:"deprecated,omitempty"` - Security []map[string][]string `json:"security,omitempty"` //Special case, see MarshalJSON function - Parameters []Parameter `json:"parameters,omitempty"` - Responses *Responses `json:"responses,omitempty"` -} - -// MarshalJSON takes care of serializing operation properties to JSON -// -// We use a custom marhaller here to handle a special cases related -// the Security field. We need to preserve zero length slice -// while omiting the field when the value is nil/unset. -func (op OperationProps) MarshalJSON() ([]byte, error) { - type Alias OperationProps - if op.Security == nil { - return json.Marshal(&struct { - Security []map[string][]string `json:"security,omitempty"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) - } - return json.Marshal(&struct { - Security []map[string][]string `json:"security"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) -} - -// Operation describes a single API operation on a path. -// -// For more information: http://goo.gl/8us55a#operationObject -type Operation struct { - VendorExtensible - OperationProps -} - -// SuccessResponse gets a success response model -func (o *Operation) SuccessResponse() (*Response, int, bool) { - if o.Responses == nil { - return nil, 0, false - } - - for k, v := range o.Responses.StatusCodeResponses { - if k/100 == 2 { - return &v, k, true - } - } - - return o.Responses.Default, 0, false -} - -// JSONLookup look up a value by the json property name -func (o Operation) JSONLookup(token string) (interface{}, error) { - if ex, ok := o.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(o.OperationProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (o *Operation) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &o.OperationProps); err != nil { - return err - } - if err := json.Unmarshal(data, &o.VendorExtensible); err != nil { - return err - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (o Operation) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(o.OperationProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(o.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// NewOperation creates a new operation instance. -// It expects an ID as parameter but not passing an ID is also valid. -func NewOperation(id string) *Operation { - op := new(Operation) - op.ID = id - return op -} - -// WithID sets the ID property on this operation, allows for chaining. -func (o *Operation) WithID(id string) *Operation { - o.ID = id - return o -} - -// WithDescription sets the description on this operation, allows for chaining -func (o *Operation) WithDescription(description string) *Operation { - o.Description = description - return o -} - -// WithSummary sets the summary on this operation, allows for chaining -func (o *Operation) WithSummary(summary string) *Operation { - o.Summary = summary - return o -} - -// WithExternalDocs sets/removes the external docs for/from this operation. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (o *Operation) WithExternalDocs(description, url string) *Operation { - if description == "" && url == "" { - o.ExternalDocs = nil - return o - } - - if o.ExternalDocs == nil { - o.ExternalDocs = &ExternalDocumentation{} - } - o.ExternalDocs.Description = description - o.ExternalDocs.URL = url - return o -} - -// Deprecate marks the operation as deprecated -func (o *Operation) Deprecate() *Operation { - o.Deprecated = true - return o -} - -// Undeprecate marks the operation as not deprected -func (o *Operation) Undeprecate() *Operation { - o.Deprecated = false - return o -} - -// WithConsumes adds media types for incoming body values -func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { - o.Consumes = append(o.Consumes, mediaTypes...) - return o -} - -// WithProduces adds media types for outgoing body values -func (o *Operation) WithProduces(mediaTypes ...string) *Operation { - o.Produces = append(o.Produces, mediaTypes...) - return o -} - -// WithTags adds tags for this operation -func (o *Operation) WithTags(tags ...string) *Operation { - o.Tags = append(o.Tags, tags...) - return o -} - -// AddParam adds a parameter to this operation, when a parameter for that location -// and with that name already exists it will be replaced -func (o *Operation) AddParam(param *Parameter) *Operation { - if param == nil { - return o - } - - for i, p := range o.Parameters { - if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) - params = append(params, o.Parameters[i+1:]...) - o.Parameters = params - return o - } - } - - o.Parameters = append(o.Parameters, *param) - return o -} - -// RemoveParam removes a parameter from the operation -func (o *Operation) RemoveParam(name, in string) *Operation { - for i, p := range o.Parameters { - if p.Name == name && p.In == name { - o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) - return o - } - } - return o -} - -// SecuredWith adds a security scope to this operation. -func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { - o.Security = append(o.Security, map[string][]string{name: scopes}) - return o -} - -// WithDefaultResponse adds a default response to the operation. -// Passing a nil value will remove the response -func (o *Operation) WithDefaultResponse(response *Response) *Operation { - return o.RespondsWith(0, response) -} - -// RespondsWith adds a status code response to the operation. -// When the code is 0 the value of the response will be used as default response value. -// When the value of the response is nil it will be removed from the operation -func (o *Operation) RespondsWith(code int, response *Response) *Operation { - if o.Responses == nil { - o.Responses = new(Responses) - } - if code == 0 { - o.Responses.Default = response - return o - } - if response == nil { - delete(o.Responses.StatusCodeResponses, code) - return o - } - if o.Responses.StatusCodeResponses == nil { - o.Responses.StatusCodeResponses = make(map[int]Response) - } - o.Responses.StatusCodeResponses[code] = *response - return o -} diff --git a/cmd/vendor/github.com/go-openapi/spec/parameter.go b/cmd/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index 71aee1e806..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// QueryParam creates a query parameter -func QueryParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} -} - -// HeaderParam creates a header parameter, this is always required by default -func HeaderParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} -} - -// PathParam creates a path parameter, this is always required -func PathParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} -} - -// BodyParam creates a body parameter -func BodyParam(name string, schema *Schema) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}, SimpleSchema: SimpleSchema{Type: "object"}} -} - -// FormDataParam creates a body parameter -func FormDataParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} -} - -// FileParam creates a body parameter -func FileParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, SimpleSchema: SimpleSchema{Type: "file"}} -} - -// SimpleArrayParam creates a param for a simple array (string, int, date etc) -func SimpleArrayParam(name, tpe, fmt string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name}, SimpleSchema: SimpleSchema{Type: "array", CollectionFormat: "csv", Items: &Items{SimpleSchema: SimpleSchema{Type: "string", Format: fmt}}}} -} - -// ParamRef creates a parameter that's a json reference -func ParamRef(uri string) *Parameter { - p := new(Parameter) - p.Ref = MustCreateRef(uri) - return p -} - -type ParamProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Required bool `json:"required,omitempty"` - Schema *Schema `json:"schema,omitempty"` // when in == "body" - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` // when in == "query" || "formData" -} - -// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). -// -// There are five possible parameter types. -// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`. -// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. -// * Header - Custom headers that are expected as part of the request. -// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be *one* body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation. -// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or `multipart/form-data` are used as the content type of the request (in Swagger's definition, the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4): -// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple parameters that are being transferred. -// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is `submit-name`. This type of form parameters is more commonly used for file transfers. -// -// For more information: http://goo.gl/8us55a#parameterObject -type Parameter struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible - ParamProps -} - -// JSONLookup look up a value by the json property name -func (p Parameter) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.ParamProps, token) - return r, err -} - -// WithDescription a fluent builder method for the description of the parameter -func (p *Parameter) WithDescription(description string) *Parameter { - p.Description = description - return p -} - -// Named a fluent builder method to override the name of the parameter -func (p *Parameter) Named(name string) *Parameter { - p.Name = name - return p -} - -// WithLocation a fluent builder method to override the location of the parameter -func (p *Parameter) WithLocation(in string) *Parameter { - p.In = in - return p -} - -// Typed a fluent builder method for the type of the parameter value -func (p *Parameter) Typed(tpe, format string) *Parameter { - p.Type = tpe - p.Format = format - return p -} - -// CollectionOf a fluent builder method for an array parameter -func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { - p.Type = "array" - p.Items = items - p.CollectionFormat = format - return p -} - -// WithDefault sets the default value on this parameter -func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { - p.AsOptional() // with default implies optional - p.Default = defaultValue - return p -} - -// AllowsEmptyValues flags this parameter as being ok with empty values -func (p *Parameter) AllowsEmptyValues() *Parameter { - p.AllowEmptyValue = true - return p -} - -// NoEmptyValues flags this parameter as not liking empty values -func (p *Parameter) NoEmptyValues() *Parameter { - p.AllowEmptyValue = false - return p -} - -// AsOptional flags this parameter as optional -func (p *Parameter) AsOptional() *Parameter { - p.Required = false - return p -} - -// AsRequired flags this parameter as required -func (p *Parameter) AsRequired() *Parameter { - if p.Default != nil { // with a default required makes no sense - return p - } - p.Required = true - return p -} - -// WithMaxLength sets a max length value -func (p *Parameter) WithMaxLength(max int64) *Parameter { - p.MaxLength = &max - return p -} - -// WithMinLength sets a min length value -func (p *Parameter) WithMinLength(min int64) *Parameter { - p.MinLength = &min - return p -} - -// WithPattern sets a pattern value -func (p *Parameter) WithPattern(pattern string) *Parameter { - p.Pattern = pattern - return p -} - -// WithMultipleOf sets a multiple of value -func (p *Parameter) WithMultipleOf(number float64) *Parameter { - p.MultipleOf = &number - return p -} - -// WithMaximum sets a maximum number value -func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { - p.Maximum = &max - p.ExclusiveMaximum = exclusive - return p -} - -// WithMinimum sets a minimum number value -func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { - p.Minimum = &min - p.ExclusiveMinimum = exclusive - return p -} - -// WithEnum sets a the enum values (replace) -func (p *Parameter) WithEnum(values ...interface{}) *Parameter { - p.Enum = append([]interface{}{}, values...) - return p -} - -// WithMaxItems sets the max items -func (p *Parameter) WithMaxItems(size int64) *Parameter { - p.MaxItems = &size - return p -} - -// WithMinItems sets the min items -func (p *Parameter) WithMinItems(size int64) *Parameter { - p.MinItems = &size - return p -} - -// UniqueValues dictates that this array can only have unique items -func (p *Parameter) UniqueValues() *Parameter { - p.UniqueItems = true - return p -} - -// AllowDuplicates this array can have duplicates -func (p *Parameter) AllowDuplicates() *Parameter { - p.UniqueItems = false - return p -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Parameter) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - if err := json.Unmarshal(data, &p.ParamProps); err != nil { - return err - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p Parameter) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(p.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.ParamProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b3, b1, b2, b4, b5), nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/path_item.go b/cmd/vendor/github.com/go-openapi/spec/path_item.go deleted file mode 100644 index 9ab3ec5383..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/path_item.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// pathItemProps the path item specific properties -type PathItemProps struct { - Get *Operation `json:"get,omitempty"` - Put *Operation `json:"put,omitempty"` - Post *Operation `json:"post,omitempty"` - Delete *Operation `json:"delete,omitempty"` - Options *Operation `json:"options,omitempty"` - Head *Operation `json:"head,omitempty"` - Patch *Operation `json:"patch,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` -} - -// PathItem describes the operations available on a single path. -// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// The path itself is still exposed to the documentation viewer but they will -// not know which operations and parameters are available. -// -// For more information: http://goo.gl/8us55a#pathItemObject -type PathItem struct { - Refable - VendorExtensible - PathItemProps -} - -// JSONLookup look up a value by the json property name -func (p PathItem) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *PathItem) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - if err := json.Unmarshal(data, &p.PathItemProps); err != nil { - return err - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p PathItem) MarshalJSON() ([]byte, error) { - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.PathItemProps) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b3, b4, b5) - return concated, nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/paths.go b/cmd/vendor/github.com/go-openapi/spec/paths.go deleted file mode 100644 index 9dc82a2901..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/paths.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-openapi/swag" -) - -// Paths holds the relative paths to the individual endpoints. -// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order -// to construct the full URL. -// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// -// For more information: http://goo.gl/8us55a#pathsObject -type Paths struct { - VendorExtensible - Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" -} - -// JSONLookup look up a value by the json property name -func (p Paths) JSONLookup(token string) (interface{}, error) { - if pi, ok := p.Paths[token]; ok { - return &pi, nil - } - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Paths) UnmarshalJSON(data []byte) error { - var res map[string]json.RawMessage - if err := json.Unmarshal(data, &res); err != nil { - return err - } - for k, v := range res { - if strings.HasPrefix(strings.ToLower(k), "x-") { - if p.Extensions == nil { - p.Extensions = make(map[string]interface{}) - } - var d interface{} - if err := json.Unmarshal(v, &d); err != nil { - return err - } - p.Extensions[k] = d - } - if strings.HasPrefix(k, "/") { - if p.Paths == nil { - p.Paths = make(map[string]PathItem) - } - var pi PathItem - if err := json.Unmarshal(v, &pi); err != nil { - return err - } - p.Paths[k] = pi - } - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p Paths) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - - pths := make(map[string]PathItem) - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - pths[k] = v - } - } - b2, err := json.Marshal(pths) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/ref.go b/cmd/vendor/github.com/go-openapi/spec/ref.go deleted file mode 100644 index 1405bfd8ee..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/ref.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "net/http" - "os" - "path/filepath" - - "github.com/go-openapi/jsonreference" -) - -// Refable is a struct for things that accept a $ref property -type Refable struct { - Ref Ref -} - -// MarshalJSON marshals the ref to json -func (r Refable) MarshalJSON() ([]byte, error) { - return r.Ref.MarshalJSON() -} - -// UnmarshalJSON unmarshalss the ref from json -func (r *Refable) UnmarshalJSON(d []byte) error { - return json.Unmarshal(d, &r.Ref) -} - -// Ref represents a json reference that is potentially resolved -type Ref struct { - jsonreference.Ref -} - -// RemoteURI gets the remote uri part of the ref -func (r *Ref) RemoteURI() string { - if r.String() == "" { - return r.String() - } - - u := *r.GetURL() - u.Fragment = "" - return u.String() -} - -// IsValidURI returns true when the url the ref points to can be found -func (r *Ref) IsValidURI(basepaths ...string) bool { - if r.String() == "" { - return true - } - - v := r.RemoteURI() - if v == "" { - return true - } - - if r.HasFullURL { - rr, err := http.Get(v) - if err != nil { - return false - } - - return rr.StatusCode/100 == 2 - } - - if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { - return false - } - - // check for local file - pth := v - if r.HasURLPathOnly { - base := "." - if len(basepaths) > 0 { - base = filepath.Dir(filepath.Join(basepaths...)) - } - p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) - if e != nil { - return false - } - pth = p - } - - fi, err := os.Stat(filepath.ToSlash(pth)) - if err != nil { - return false - } - - return !fi.IsDir() -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - ref, err := r.Ref.Inherits(child.Ref) - if err != nil { - return nil, err - } - return &Ref{Ref: *ref}, nil -} - -// NewRef creates a new instance of a ref object -// returns an error when the reference uri is an invalid uri -func NewRef(refURI string) (Ref, error) { - ref, err := jsonreference.New(refURI) - if err != nil { - return Ref{}, err - } - return Ref{Ref: ref}, nil -} - -// MustCreateRef creates a ref object but panics when refURI is invalid. -// Use the NewRef method for a version that returns an error. -func MustCreateRef(refURI string) Ref { - return Ref{Ref: jsonreference.MustCreateRef(refURI)} -} - -// MarshalJSON marshals this ref into a JSON object -func (r Ref) MarshalJSON() ([]byte, error) { - str := r.String() - if str == "" { - if r.IsRoot() { - return []byte(`{"$ref":""}`), nil - } - return []byte("{}"), nil - } - v := map[string]interface{}{"$ref": str} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshals this ref from a JSON object -func (r *Ref) UnmarshalJSON(d []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(d, &v); err != nil { - return err - } - return r.fromMap(v) -} - -func (r *Ref) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - - if vv, ok := v["$ref"]; ok { - if str, ok := vv.(string); ok { - ref, err := jsonreference.New(str) - if err != nil { - return err - } - *r = Ref{Ref: ref} - } - } - - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/response.go b/cmd/vendor/github.com/go-openapi/spec/response.go deleted file mode 100644 index a32b039eaf..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/response.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// ResponseProps properties specific to a response -type ResponseProps struct { - Description string `json:"description,omitempty"` - Schema *Schema `json:"schema,omitempty"` - Headers map[string]Header `json:"headers,omitempty"` - Examples map[string]interface{} `json:"examples,omitempty"` -} - -// Response describes a single response from an API Operation. -// -// For more information: http://goo.gl/8us55a#responseObject -type Response struct { - Refable - ResponseProps - VendorExtensible -} - -// JSONLookup look up a value by the json property name -func (p Response) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.ResponseProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Response) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponseProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { - return err - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (r Response) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponseProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(r.Refable) - if err != nil { - return nil, err - } - b3, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// NewResponse creates a new response instance -func NewResponse() *Response { - return new(Response) -} - -// ResponseRef creates a response as a json reference -func ResponseRef(url string) *Response { - resp := NewResponse() - resp.Ref = MustCreateRef(url) - return resp -} - -// WithDescription sets the description on this response, allows for chaining -func (r *Response) WithDescription(description string) *Response { - r.Description = description - return r -} - -// WithSchema sets the schema on this response, allows for chaining. -// Passing a nil argument removes the schema from this response -func (r *Response) WithSchema(schema *Schema) *Response { - r.Schema = schema - return r -} - -// AddHeader adds a header to this response -func (r *Response) AddHeader(name string, header *Header) *Response { - if header == nil { - return r.RemoveHeader(name) - } - if r.Headers == nil { - r.Headers = make(map[string]Header) - } - r.Headers[name] = *header - return r -} - -// RemoveHeader removes a header from this response -func (r *Response) RemoveHeader(name string) *Response { - delete(r.Headers, name) - return r -} - -// AddExample adds an example to this response -func (r *Response) AddExample(mediaType string, example interface{}) *Response { - if r.Examples == nil { - r.Examples = make(map[string]interface{}) - } - r.Examples[mediaType] = example - return r -} diff --git a/cmd/vendor/github.com/go-openapi/spec/responses.go b/cmd/vendor/github.com/go-openapi/spec/responses.go deleted file mode 100644 index 3ab06697f2..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/responses.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" - - "github.com/go-openapi/swag" -) - -// Responses is a container for the expected responses of an operation. -// The container maps a HTTP response code to the expected response. -// It is not expected from the documentation to necessarily cover all possible HTTP response codes, -// since they may not be known in advance. However, it is expected from the documentation to cover -// a successful operation response and any known errors. -// -// The `default` can be used a default response object for all HTTP codes that are not covered -// individually by the specification. -// -// The `Responses Object` MUST contain at least one response code, and it SHOULD be the response -// for a successful operation call. -// -// For more information: http://goo.gl/8us55a#responsesObject -type Responses struct { - VendorExtensible - ResponsesProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (r Responses) JSONLookup(token string) (interface{}, error) { - if token == "default" { - return r.Default, nil - } - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if i, err := strconv.Atoi(token); err == nil { - if scr, ok := r.StatusCodeResponses[i]; ok { - return scr, nil - } - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Responses) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { - return err - } - if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) { - r.ResponsesProps = ResponsesProps{} - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (r Responses) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponsesProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -type ResponsesProps struct { - Default *Response - StatusCodeResponses map[int]Response -} - -func (r ResponsesProps) MarshalJSON() ([]byte, error) { - toser := map[string]Response{} - if r.Default != nil { - toser["default"] = *r.Default - } - for k, v := range r.StatusCodeResponses { - toser[strconv.Itoa(k)] = v - } - return json.Marshal(toser) -} - -func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]Response - if err := json.Unmarshal(data, &res); err != nil { - return nil - } - if v, ok := res["default"]; ok { - r.Default = &v - delete(res, "default") - } - for k, v := range res { - if nk, err := strconv.Atoi(k); err == nil { - if r.StatusCodeResponses == nil { - r.StatusCodeResponses = map[int]Response{} - } - r.StatusCodeResponses[nk] = v - } - } - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/schema.go b/cmd/vendor/github.com/go-openapi/spec/schema.go deleted file mode 100644 index 05c1a4aa0e..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/schema.go +++ /dev/null @@ -1,634 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// BooleanProperty creates a boolean property -func BooleanProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}} -} - -// BoolProperty creates a boolean property -func BoolProperty() *Schema { return BooleanProperty() } - -// StringProperty creates a string property -func StringProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// CharProperty creates a string property -func CharProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// Float64Property creates a float64/double property -func Float64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}} -} - -// Float32Property creates a float32/float property -func Float32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}} -} - -// Int8Property creates an int8 property -func Int8Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}} -} - -// Int16Property creates an int16 property -func Int16Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}} -} - -// Int32Property creates an int32 property -func Int32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}} -} - -// Int64Property creates an int64 property -func Int64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}} -} - -// StrFmtProperty creates a property for the named string format -func StrFmtProperty(format string) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}} -} - -// DateProperty creates a date property -func DateProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}} -} - -// DateTimeProperty creates a date time property -func DateTimeProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}} -} - -// MapProperty creates a map property -func MapProperty(property *Schema) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}} -} - -// RefProperty creates a ref property -func RefProperty(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// RefSchema creates a ref property -func RefSchema(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// ArrayProperty creates an array property -func ArrayProperty(items *Schema) *Schema { - if items == nil { - return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}} - } - return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}} -} - -// ComposedSchema creates a schema with allOf -func ComposedSchema(schemas ...Schema) *Schema { - s := new(Schema) - s.AllOf = schemas - return s -} - -// SchemaURL represents a schema url -type SchemaURL string - -// MarshalJSON marshal this to JSON -func (r SchemaURL) MarshalJSON() ([]byte, error) { - if r == "" { - return []byte("{}"), nil - } - v := map[string]interface{}{"$schema": string(r)} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshal this from JSON -func (r *SchemaURL) UnmarshalJSON(data []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(data, &v); err != nil { - return err - } - return r.fromMap(v) -} - -func (r *SchemaURL) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - if vv, ok := v["$schema"]; ok { - if str, ok := vv.(string); ok { - u, err := url.Parse(str) - if err != nil { - return err - } - - *r = SchemaURL(u.String()) - } - } - return nil -} - -// type ExtraSchemaProps map[string]interface{} - -// // JSONSchema represents a structure that is a json schema draft 04 -// type JSONSchema struct { -// SchemaProps -// ExtraSchemaProps -// } - -// // MarshalJSON marshal this to JSON -// func (s JSONSchema) MarshalJSON() ([]byte, error) { -// b1, err := json.Marshal(s.SchemaProps) -// if err != nil { -// return nil, err -// } -// b2, err := s.Ref.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b3, err := s.Schema.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b4, err := json.Marshal(s.ExtraSchemaProps) -// if err != nil { -// return nil, err -// } -// return swag.ConcatJSON(b1, b2, b3, b4), nil -// } - -// // UnmarshalJSON marshal this from JSON -// func (s *JSONSchema) UnmarshalJSON(data []byte) error { -// var sch JSONSchema -// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Ref); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Schema); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil { -// return err -// } -// *s = sch -// return nil -// } - -type SchemaProps struct { - ID string `json:"id,omitempty"` - Ref Ref `json:"-"` - Schema SchemaURL `json:"-"` - Description string `json:"description,omitempty"` - Type StringOrArray `json:"type,omitempty"` - Format string `json:"format,omitempty"` - Title string `json:"title,omitempty"` - Default interface{} `json:"default,omitempty"` - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` - Required []string `json:"required,omitempty"` - Items *SchemaOrArray `json:"items,omitempty"` - AllOf []Schema `json:"allOf,omitempty"` - OneOf []Schema `json:"oneOf,omitempty"` - AnyOf []Schema `json:"anyOf,omitempty"` - Not *Schema `json:"not,omitempty"` - Properties map[string]Schema `json:"properties,omitempty"` - AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` - PatternProperties map[string]Schema `json:"patternProperties,omitempty"` - Dependencies Dependencies `json:"dependencies,omitempty"` - AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"` - Definitions Definitions `json:"definitions,omitempty"` -} - -type SwaggerSchemaProps struct { - Discriminator string `json:"discriminator,omitempty"` - ReadOnly bool `json:"readOnly,omitempty"` - XML *XMLObject `json:"xml,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// Schema the schema object allows the definition of input and output data types. -// These types can be objects, but also primitives and arrays. -// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) -// and uses a predefined subset of it. -// On top of this subset, there are extensions provided by this specification to allow for more complete documentation. -// -// For more information: http://goo.gl/8us55a#schemaObject -type Schema struct { - VendorExtensible - SchemaProps - SwaggerSchemaProps - ExtraProps map[string]interface{} `json:"-"` -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s Schema) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - if ex, ok := s.ExtraProps[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) - if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { - return r, err - } - r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) - return r, err -} - -// WithID sets the id for this schema, allows for chaining -func (s *Schema) WithID(id string) *Schema { - s.ID = id - return s -} - -// WithTitle sets the title for this schema, allows for chaining -func (s *Schema) WithTitle(title string) *Schema { - s.Title = title - return s -} - -// WithDescription sets the description for this schema, allows for chaining -func (s *Schema) WithDescription(description string) *Schema { - s.Description = description - return s -} - -// WithProperties sets the properties for this schema -func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { - s.Properties = schemas - return s -} - -// SetProperty sets a property on this schema -func (s *Schema) SetProperty(name string, schema Schema) *Schema { - if s.Properties == nil { - s.Properties = make(map[string]Schema) - } - s.Properties[name] = schema - return s -} - -// WithAllOf sets the all of property -func (s *Schema) WithAllOf(schemas ...Schema) *Schema { - s.AllOf = schemas - return s -} - -// WithMaxProperties sets the max number of properties an object can have -func (s *Schema) WithMaxProperties(max int64) *Schema { - s.MaxProperties = &max - return s -} - -// WithMinProperties sets the min number of properties an object must have -func (s *Schema) WithMinProperties(min int64) *Schema { - s.MinProperties = &min - return s -} - -// Typed sets the type of this schema for a single value item -func (s *Schema) Typed(tpe, format string) *Schema { - s.Type = []string{tpe} - s.Format = format - return s -} - -// AddType adds a type with potential format to the types for this schema -func (s *Schema) AddType(tpe, format string) *Schema { - s.Type = append(s.Type, tpe) - if format != "" { - s.Format = format - } - return s -} - -// CollectionOf a fluent builder method for an array parameter -func (s *Schema) CollectionOf(items Schema) *Schema { - s.Type = []string{"array"} - s.Items = &SchemaOrArray{Schema: &items} - return s -} - -// WithDefault sets the default value on this parameter -func (s *Schema) WithDefault(defaultValue interface{}) *Schema { - s.Default = defaultValue - return s -} - -// WithRequired flags this parameter as required -func (s *Schema) WithRequired(items ...string) *Schema { - s.Required = items - return s -} - -// AddRequired adds field names to the required properties array -func (s *Schema) AddRequired(items ...string) *Schema { - s.Required = append(s.Required, items...) - return s -} - -// WithMaxLength sets a max length value -func (s *Schema) WithMaxLength(max int64) *Schema { - s.MaxLength = &max - return s -} - -// WithMinLength sets a min length value -func (s *Schema) WithMinLength(min int64) *Schema { - s.MinLength = &min - return s -} - -// WithPattern sets a pattern value -func (s *Schema) WithPattern(pattern string) *Schema { - s.Pattern = pattern - return s -} - -// WithMultipleOf sets a multiple of value -func (s *Schema) WithMultipleOf(number float64) *Schema { - s.MultipleOf = &number - return s -} - -// WithMaximum sets a maximum number value -func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { - s.Maximum = &max - s.ExclusiveMaximum = exclusive - return s -} - -// WithMinimum sets a minimum number value -func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { - s.Minimum = &min - s.ExclusiveMinimum = exclusive - return s -} - -// WithEnum sets a the enum values (replace) -func (s *Schema) WithEnum(values ...interface{}) *Schema { - s.Enum = append([]interface{}{}, values...) - return s -} - -// WithMaxItems sets the max items -func (s *Schema) WithMaxItems(size int64) *Schema { - s.MaxItems = &size - return s -} - -// WithMinItems sets the min items -func (s *Schema) WithMinItems(size int64) *Schema { - s.MinItems = &size - return s -} - -// UniqueValues dictates that this array can only have unique items -func (s *Schema) UniqueValues() *Schema { - s.UniqueItems = true - return s -} - -// AllowDuplicates this array can have duplicates -func (s *Schema) AllowDuplicates() *Schema { - s.UniqueItems = false - return s -} - -// AddToAllOf adds a schema to the allOf property -func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { - s.AllOf = append(s.AllOf, schemas...) - return s -} - -// WithDiscriminator sets the name of the discriminator field -func (s *Schema) WithDiscriminator(discriminator string) *Schema { - s.Discriminator = discriminator - return s -} - -// AsReadOnly flags this schema as readonly -func (s *Schema) AsReadOnly() *Schema { - s.ReadOnly = true - return s -} - -// AsWritable flags this schema as writeable (not read-only) -func (s *Schema) AsWritable() *Schema { - s.ReadOnly = false - return s -} - -// WithExample sets the example for this schema -func (s *Schema) WithExample(example interface{}) *Schema { - s.Example = example - return s -} - -// WithExternalDocs sets/removes the external docs for/from this schema. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (s *Schema) WithExternalDocs(description, url string) *Schema { - if description == "" && url == "" { - s.ExternalDocs = nil - return s - } - - if s.ExternalDocs == nil { - s.ExternalDocs = &ExternalDocumentation{} - } - s.ExternalDocs.Description = description - s.ExternalDocs.URL = url - return s -} - -// WithXMLName sets the xml name for the object -func (s *Schema) WithXMLName(name string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Name = name - return s -} - -// WithXMLNamespace sets the xml namespace for the object -func (s *Schema) WithXMLNamespace(namespace string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Namespace = namespace - return s -} - -// WithXMLPrefix sets the xml prefix for the object -func (s *Schema) WithXMLPrefix(prefix string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Prefix = prefix - return s -} - -// AsXMLAttribute flags this object as xml attribute -func (s *Schema) AsXMLAttribute() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = true - return s -} - -// AsXMLElement flags this object as an xml node -func (s *Schema) AsXMLElement() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = false - return s -} - -// AsWrappedXML flags this object as wrapped, this is mostly useful for array types -func (s *Schema) AsWrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = true - return s -} - -// AsUnwrappedXML flags this object as an xml node -func (s *Schema) AsUnwrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = false - return s -} - -// MarshalJSON marshal this to JSON -func (s Schema) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SchemaProps) - if err != nil { - return nil, fmt.Errorf("schema props %v", err) - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, fmt.Errorf("vendor props %v", err) - } - b3, err := s.Ref.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("ref prop %v", err) - } - b4, err := s.Schema.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("schema prop %v", err) - } - b5, err := json.Marshal(s.SwaggerSchemaProps) - if err != nil { - return nil, fmt.Errorf("common validations %v", err) - } - var b6 []byte - if s.ExtraProps != nil { - jj, err := json.Marshal(s.ExtraProps) - if err != nil { - return nil, fmt.Errorf("extra props %v", err) - } - b6 = jj - } - return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *Schema) UnmarshalJSON(data []byte) error { - props := struct { - SchemaProps - SwaggerSchemaProps - }{} - if err := json.Unmarshal(data, &props); err != nil { - return err - } - - sch := Schema{ - SchemaProps: props.SchemaProps, - SwaggerSchemaProps: props.SwaggerSchemaProps, - } - - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - - sch.Ref.fromMap(d) - sch.Schema.fromMap(d) - - delete(d, "$ref") - delete(d, "$schema") - for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { - delete(d, pn) - } - - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if sch.Extensions == nil { - sch.Extensions = map[string]interface{}{} - } - sch.Extensions[k] = vv - continue - } - if sch.ExtraProps == nil { - sch.ExtraProps = map[string]interface{}{} - } - sch.ExtraProps[k] = vv - } - - *s = sch - - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/security_scheme.go b/cmd/vendor/github.com/go-openapi/spec/security_scheme.go deleted file mode 100644 index 22d4f10af2..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/security_scheme.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - basic = "basic" - apiKey = "apiKey" - oauth2 = "oauth2" - implicit = "implicit" - password = "password" - application = "application" - accessCode = "accessCode" -) - -// BasicAuth creates a basic auth security scheme -func BasicAuth() *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} -} - -// APIKeyAuth creates an api key auth security scheme -func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} -} - -// OAuth2Implicit creates an implicit flow oauth2 security scheme -func OAuth2Implicit(authorizationURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: implicit, - AuthorizationURL: authorizationURL, - }} -} - -// OAuth2Password creates a password flow oauth2 security scheme -func OAuth2Password(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: password, - TokenURL: tokenURL, - }} -} - -// OAuth2Application creates an application flow oauth2 security scheme -func OAuth2Application(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: application, - TokenURL: tokenURL, - }} -} - -// OAuth2AccessToken creates an access token flow oauth2 security scheme -func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: accessCode, - AuthorizationURL: authorizationURL, - TokenURL: tokenURL, - }} -} - -type SecuritySchemeProps struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2 - TokenURL string `json:"tokenUrl,omitempty"` // oauth2 - Scopes map[string]string `json:"scopes,omitempty"` // oauth2 -} - -// AddScope adds a scope to this security scheme -func (s *SecuritySchemeProps) AddScope(scope, description string) { - if s.Scopes == nil { - s.Scopes = make(map[string]string) - } - s.Scopes[scope] = description -} - -// SecurityScheme allows the definition of a security scheme that can be used by the operations. -// Supported schemes are basic authentication, an API key (either as a header or as a query parameter) -// and OAuth2's common flows (implicit, password, application and access code). -// -// For more information: http://goo.gl/8us55a#securitySchemeObject -type SecurityScheme struct { - VendorExtensible - SecuritySchemeProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (s SecurityScheme) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SecuritySchemeProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *SecurityScheme) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { - return err - } - if err := json.Unmarshal(data, &s.VendorExtensible); err != nil { - return err - } - return nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/spec.go b/cmd/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 0bb045bc06..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/spec.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import "encoding/json" - -//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json -//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema -//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... -//go:generate perl -pi -e s,Json,JSON,g bindata.go - -const ( - // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs - SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" - // JSONSchemaURL the url for the json schema schema - JSONSchemaURL = "http://json-schema.org/draft-04/schema#" -) - -var ( - jsonSchema *Schema - swaggerSchema *Schema -) - -func init() { - jsonSchema = MustLoadJSONSchemaDraft04() - swaggerSchema = MustLoadSwagger20Schema() -} - -// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error -func MustLoadJSONSchemaDraft04() *Schema { - d, e := JSONSchemaDraft04() - if e != nil { - panic(e) - } - return d -} - -// JSONSchemaDraft04 loads the json schema document for json shema draft04 -func JSONSchemaDraft04() (*Schema, error) { - b, err := Asset("jsonschema-draft-04.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} - -// MustLoadSwagger20Schema panics when Swagger20Schema returns an error -func MustLoadSwagger20Schema() *Schema { - d, e := Swagger20Schema() - if e != nil { - panic(e) - } - return d -} - -// Swagger20Schema loads the swagger 2.0 schema from the embedded assets -func Swagger20Schema() (*Schema, error) { - - b, err := Asset("v2/schema.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} diff --git a/cmd/vendor/github.com/go-openapi/spec/swagger.go b/cmd/vendor/github.com/go-openapi/spec/swagger.go deleted file mode 100644 index 23780c78a2..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/swagger.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strconv" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Swagger this is the root document object for the API specification. -// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document. -// -// For more information: http://goo.gl/8us55a#swagger-object- -type Swagger struct { - VendorExtensible - SwaggerProps -} - -// JSONLookup look up a value by the json property name -func (s Swagger) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) - return r, err -} - -// MarshalJSON marshals this swagger structure to json -func (s Swagger) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SwaggerProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON unmarshals a swagger spec from json -func (s *Swagger) UnmarshalJSON(data []byte) error { - var sw Swagger - if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { - return err - } - if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { - return err - } - *s = sw - return nil -} - -type SwaggerProps struct { - ID string `json:"id,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] - Swagger string `json:"swagger,omitempty"` - Info *Info `json:"info,omitempty"` - Host string `json:"host,omitempty"` - BasePath string `json:"basePath,omitempty"` // must start with a leading "/" - Paths *Paths `json:"paths"` // required - Definitions Definitions `json:"definitions,omitempty"` - Parameters map[string]Parameter `json:"parameters,omitempty"` - Responses map[string]Response `json:"responses,omitempty"` - SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Tags []Tag `json:"tags,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -// Dependencies represent a dependencies property -type Dependencies map[string]SchemaOrStringArray - -// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property -type SchemaOrBool struct { - Allows bool - Schema *Schema -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { - if token == "allows" { - return s.Allows, nil - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -var jsTrue = []byte("true") -var jsFalse = []byte("false") - -// MarshalJSON convert this object to JSON -func (s SchemaOrBool) MarshalJSON() ([]byte, error) { - if s.Schema != nil { - return json.Marshal(s.Schema) - } - - if s.Schema == nil && !s.Allows { - return jsFalse, nil - } - return jsTrue, nil -} - -// UnmarshalJSON converts this bool or schema object from a JSON structure -func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { - var nw SchemaOrBool - if len(data) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') - } - *s = nw - return nil -} - -// SchemaOrStringArray represents a schema or a string array -type SchemaOrStringArray struct { - Schema *Schema - Property []string -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { - if len(s.Property) > 0 { - return json.Marshal(s.Property) - } - if s.Schema != nil { - return json.Marshal(s.Schema) - } - return []byte("null"), nil -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - var nw SchemaOrStringArray - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Property); err != nil { - return err - } - } - *s = nw - return nil -} - -// Definitions contains the models explicitly defined in this spec -// An object to hold data types that can be consumed and produced by operations. -// These data types can be primitives, arrays or models. -// -// For more information: http://goo.gl/8us55a#definitionsObject -type Definitions map[string]Schema - -// SecurityDefinitions a declaration of the security schemes available to be used in the specification. -// This does not enforce the security schemes on the operations and only serves to provide -// the relevant details for each scheme. -// -// For more information: http://goo.gl/8us55a#securityDefinitionsObject -type SecurityDefinitions map[string]*SecurityScheme - -// StringOrArray represents a value that can either be a string -// or an array of strings. Mainly here for serialization purposes -type StringOrArray []string - -// Contains returns true when the value is contained in the slice -func (s StringOrArray) Contains(value string) bool { - for _, str := range s { - if str == value { - return true - } - } - return false -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { - if _, err := strconv.Atoi(token); err == nil { - r, _, err := jsonpointer.GetForToken(s.Schemas, token) - return r, err - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string -func (s *StringOrArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - - if first == '[' { - var parsed []string - if err := json.Unmarshal(data, &parsed); err != nil { - return err - } - *s = StringOrArray(parsed) - return nil - } - - var single interface{} - if err := json.Unmarshal(data, &single); err != nil { - return err - } - if single == nil { - return nil - } - switch single.(type) { - case string: - *s = StringOrArray([]string{single.(string)}) - return nil - default: - return fmt.Errorf("only string or array is allowed, not %T", single) - } -} - -// MarshalJSON converts this string or array to a JSON array or JSON string -func (s StringOrArray) MarshalJSON() ([]byte, error) { - if len(s) == 1 { - return json.Marshal([]string(s)[0]) - } - return json.Marshal([]string(s)) -} - -// SchemaOrArray represents a value that can either be a Schema -// or an array of Schema. Mainly here for serialization purposes -type SchemaOrArray struct { - Schema *Schema - Schemas []Schema -} - -// Len returns the number of schemas in this property -func (s SchemaOrArray) Len() int { - if s.Schema != nil { - return 1 - } - return len(s.Schemas) -} - -// ContainsType returns true when one of the schemas is of the specified type -func (s *SchemaOrArray) ContainsType(name string) bool { - if s.Schema != nil { - return s.Schema.Type != nil && s.Schema.Type.Contains(name) - } - return false -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrArray) MarshalJSON() ([]byte, error) { - if len(s.Schemas) > 0 { - return json.Marshal(s.Schemas) - } - return json.Marshal(s.Schema) -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { - var nw SchemaOrArray - var first byte - if len(data) > 1 { - first = data[0] - } - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Schemas); err != nil { - return err - } - } - *s = nw - return nil -} - -// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/cmd/vendor/github.com/go-openapi/spec/tag.go b/cmd/vendor/github.com/go-openapi/spec/tag.go deleted file mode 100644 index 97f555840c..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/tag.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -type TagProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -// NewTag creates a new tag -func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { - return Tag{TagProps: TagProps{description, name, externalDocs}} -} - -// Tag allows adding meta data to a single tag that is used by the [Operation Object](http://goo.gl/8us55a#operationObject). -// It is not mandatory to have a Tag Object per tag used there. -// -// For more information: http://goo.gl/8us55a#tagObject -type Tag struct { - VendorExtensible - TagProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (t Tag) JSONLookup(token string) (interface{}, error) { - if ex, ok := t.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(t.TagProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (t Tag) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(t.TagProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(t.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (t *Tag) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &t.TagProps); err != nil { - return err - } - return json.Unmarshal(data, &t.VendorExtensible) -} diff --git a/cmd/vendor/github.com/go-openapi/spec/xml_object.go b/cmd/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a46703d..0000000000 --- a/cmd/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// XMLObject a metadata object that allows for more fine-tuned XML model definitions. -// -// For more information: http://goo.gl/8us55a#xmlObject -type XMLObject struct { - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Prefix string `json:"prefix,omitempty"` - Attribute bool `json:"attribute,omitempty"` - Wrapped bool `json:"wrapped,omitempty"` -} - -// WithName sets the xml name for the object -func (x *XMLObject) WithName(name string) *XMLObject { - x.Name = name - return x -} - -// WithNamespace sets the xml namespace for the object -func (x *XMLObject) WithNamespace(namespace string) *XMLObject { - x.Namespace = namespace - return x -} - -// WithPrefix sets the xml prefix for the object -func (x *XMLObject) WithPrefix(prefix string) *XMLObject { - x.Prefix = prefix - return x -} - -// AsAttribute flags this object as xml attribute -func (x *XMLObject) AsAttribute() *XMLObject { - x.Attribute = true - return x -} - -// AsElement flags this object as an xml node -func (x *XMLObject) AsElement() *XMLObject { - x.Attribute = false - return x -} - -// AsWrapped flags this object as wrapped, this is mostly useful for array types -func (x *XMLObject) AsWrapped() *XMLObject { - x.Wrapped = true - return x -} - -// AsUnwrapped flags this object as an xml node -func (x *XMLObject) AsUnwrapped() *XMLObject { - x.Wrapped = false - return x -} diff --git a/cmd/vendor/github.com/go-openapi/swag/LICENSE b/cmd/vendor/github.com/go-openapi/swag/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cmd/vendor/github.com/go-openapi/swag/convert.go b/cmd/vendor/github.com/go-openapi/swag/convert.go deleted file mode 100644 index 2bf5ecbba2..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/convert.go +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "math" - "strconv" - "strings" -) - -// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER -const ( - maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1 - minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1 -) - -// IsFloat64AJSONInteger allow for integers [-2^53, 2^53-1] inclusive -func IsFloat64AJSONInteger(f float64) bool { - if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat { - return false - } - - return f == float64(int64(f)) || f == float64(uint64(f)) -} - -var evaluatesAsTrue = map[string]struct{}{ - "true": struct{}{}, - "1": struct{}{}, - "yes": struct{}{}, - "ok": struct{}{}, - "y": struct{}{}, - "on": struct{}{}, - "selected": struct{}{}, - "checked": struct{}{}, - "t": struct{}{}, - "enabled": struct{}{}, -} - -// ConvertBool turn a string into a boolean -func ConvertBool(str string) (bool, error) { - _, ok := evaluatesAsTrue[strings.ToLower(str)] - return ok, nil -} - -// ConvertFloat32 turn a string into a float32 -func ConvertFloat32(str string) (float32, error) { - f, err := strconv.ParseFloat(str, 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -// ConvertFloat64 turn a string into a float64 -func ConvertFloat64(str string) (float64, error) { - return strconv.ParseFloat(str, 64) -} - -// ConvertInt8 turn a string into int8 boolean -func ConvertInt8(str string) (int8, error) { - i, err := strconv.ParseInt(str, 10, 8) - if err != nil { - return 0, err - } - return int8(i), nil -} - -// ConvertInt16 turn a string into a int16 -func ConvertInt16(str string) (int16, error) { - i, err := strconv.ParseInt(str, 10, 16) - if err != nil { - return 0, err - } - return int16(i), nil -} - -// ConvertInt32 turn a string into a int32 -func ConvertInt32(str string) (int32, error) { - i, err := strconv.ParseInt(str, 10, 32) - if err != nil { - return 0, err - } - return int32(i), nil -} - -// ConvertInt64 turn a string into a int64 -func ConvertInt64(str string) (int64, error) { - return strconv.ParseInt(str, 10, 64) -} - -// ConvertUint8 turn a string into a uint8 -func ConvertUint8(str string) (uint8, error) { - i, err := strconv.ParseUint(str, 10, 8) - if err != nil { - return 0, err - } - return uint8(i), nil -} - -// ConvertUint16 turn a string into a uint16 -func ConvertUint16(str string) (uint16, error) { - i, err := strconv.ParseUint(str, 10, 16) - if err != nil { - return 0, err - } - return uint16(i), nil -} - -// ConvertUint32 turn a string into a uint32 -func ConvertUint32(str string) (uint32, error) { - i, err := strconv.ParseUint(str, 10, 32) - if err != nil { - return 0, err - } - return uint32(i), nil -} - -// ConvertUint64 turn a string into a uint64 -func ConvertUint64(str string) (uint64, error) { - return strconv.ParseUint(str, 10, 64) -} - -// FormatBool turns a boolean into a string -func FormatBool(value bool) string { - return strconv.FormatBool(value) -} - -// FormatFloat32 turns a float32 into a string -func FormatFloat32(value float32) string { - return strconv.FormatFloat(float64(value), 'f', -1, 32) -} - -// FormatFloat64 turns a float64 into a string -func FormatFloat64(value float64) string { - return strconv.FormatFloat(value, 'f', -1, 64) -} - -// FormatInt8 turns an int8 into a string -func FormatInt8(value int8) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt16 turns an int16 into a string -func FormatInt16(value int16) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt32 turns an int32 into a string -func FormatInt32(value int32) string { - return strconv.Itoa(int(value)) -} - -// FormatInt64 turns an int64 into a string -func FormatInt64(value int64) string { - return strconv.FormatInt(value, 10) -} - -// FormatUint8 turns an uint8 into a string -func FormatUint8(value uint8) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint16 turns an uint16 into a string -func FormatUint16(value uint16) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint32 turns an uint32 into a string -func FormatUint32(value uint32) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint64 turns an uint64 into a string -func FormatUint64(value uint64) string { - return strconv.FormatUint(value, 10) -} diff --git a/cmd/vendor/github.com/go-openapi/swag/convert_types.go b/cmd/vendor/github.com/go-openapi/swag/convert_types.go deleted file mode 100644 index c95e4e78bd..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/convert_types.go +++ /dev/null @@ -1,595 +0,0 @@ -package swag - -import "time" - -// This file was taken from the aws go sdk - -// String returns a pointer to of the string value passed in. -func String(v string) *string { - return &v -} - -// StringValue returns the value of the string pointer passed in or -// "" if the pointer is nil. -func StringValue(v *string) string { - if v != nil { - return *v - } - return "" -} - -// StringSlice converts a slice of string values into a slice of -// string pointers -func StringSlice(src []string) []*string { - dst := make([]*string, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// StringValueSlice converts a slice of string pointers into a slice of -// string values -func StringValueSlice(src []*string) []string { - dst := make([]string, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// StringMap converts a string map of string values into a string -// map of string pointers -func StringMap(src map[string]string) map[string]*string { - dst := make(map[string]*string) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// StringValueMap converts a string map of string pointers into a string -// map of string values -func StringValueMap(src map[string]*string) map[string]string { - dst := make(map[string]string) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Bool returns a pointer to of the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolValue returns the value of the bool pointer passed in or -// false if the pointer is nil. -func BoolValue(v *bool) bool { - if v != nil { - return *v - } - return false -} - -// BoolSlice converts a slice of bool values into a slice of -// bool pointers -func BoolSlice(src []bool) []*bool { - dst := make([]*bool, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// BoolValueSlice converts a slice of bool pointers into a slice of -// bool values -func BoolValueSlice(src []*bool) []bool { - dst := make([]bool, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// BoolMap converts a string map of bool values into a string -// map of bool pointers -func BoolMap(src map[string]bool) map[string]*bool { - dst := make(map[string]*bool) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// BoolValueMap converts a string map of bool pointers into a string -// map of bool values -func BoolValueMap(src map[string]*bool) map[string]bool { - dst := make(map[string]bool) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int returns a pointer to of the int value passed in. -func Int(v int) *int { - return &v -} - -// IntValue returns the value of the int pointer passed in or -// 0 if the pointer is nil. -func IntValue(v *int) int { - if v != nil { - return *v - } - return 0 -} - -// IntSlice converts a slice of int values into a slice of -// int pointers -func IntSlice(src []int) []*int { - dst := make([]*int, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// IntValueSlice converts a slice of int pointers into a slice of -// int values -func IntValueSlice(src []*int) []int { - dst := make([]int, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// IntMap converts a string map of int values into a string -// map of int pointers -func IntMap(src map[string]int) map[string]*int { - dst := make(map[string]*int) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// IntValueMap converts a string map of int pointers into a string -// map of int values -func IntValueMap(src map[string]*int) map[string]int { - dst := make(map[string]int) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int32 returns a pointer to of the int64 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int32Value(v *int32) int32 { - if v != nil { - return *v - } - return 0 -} - -// Int32Slice converts a slice of int64 values into a slice of -// int32 pointers -func Int32Slice(src []int32) []*int32 { - dst := make([]*int32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int32ValueSlice converts a slice of int32 pointers into a slice of -// int32 values -func Int32ValueSlice(src []*int32) []int32 { - dst := make([]int32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int32Map converts a string map of int32 values into a string -// map of int32 pointers -func Int32Map(src map[string]int32) map[string]*int32 { - dst := make(map[string]*int32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int32ValueMap converts a string map of int32 pointers into a string -// map of int32 values -func Int32ValueMap(src map[string]*int32) map[string]int32 { - dst := make(map[string]int32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int64 returns a pointer to of the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int64Value(v *int64) int64 { - if v != nil { - return *v - } - return 0 -} - -// Int64Slice converts a slice of int64 values into a slice of -// int64 pointers -func Int64Slice(src []int64) []*int64 { - dst := make([]*int64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int64ValueSlice converts a slice of int64 pointers into a slice of -// int64 values -func Int64ValueSlice(src []*int64) []int64 { - dst := make([]int64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int64Map converts a string map of int64 values into a string -// map of int64 pointers -func Int64Map(src map[string]int64) map[string]*int64 { - dst := make(map[string]*int64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int64ValueMap converts a string map of int64 pointers into a string -// map of int64 values -func Int64ValueMap(src map[string]*int64) map[string]int64 { - dst := make(map[string]int64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint returns a pouinter to of the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pouinter passed in or -// 0 if the pouinter is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values uinto a slice of -// uint pouinters -func UintSlice(src []uint) []*uint { - dst := make([]*uint, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// UintValueSlice converts a slice of uint pouinters uinto a slice of -// uint values -func UintValueSlice(src []*uint) []uint { - dst := make([]uint, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// UintMap converts a string map of uint values uinto a string -// map of uint pouinters -func UintMap(src map[string]uint) map[string]*uint { - dst := make(map[string]*uint) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// UintValueMap converts a string map of uint pouinters uinto a string -// map of uint values -func UintValueMap(src map[string]*uint) map[string]uint { - dst := make(map[string]uint) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint32 returns a pouinter to of the uint64 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint64 values uinto a slice of -// uint32 pouinters -func Uint32Slice(src []uint32) []*uint32 { - dst := make([]*uint32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of -// uint32 values -func Uint32ValueSlice(src []*uint32) []uint32 { - dst := make([]uint32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint32Map converts a string map of uint32 values uinto a string -// map of uint32 pouinters -func Uint32Map(src map[string]uint32) map[string]*uint32 { - dst := make(map[string]*uint32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint32ValueMap converts a string map of uint32 pouinters uinto a string -// map of uint32 values -func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { - dst := make(map[string]uint32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint64 returns a pouinter to of the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values uinto a slice of -// uint64 pouinters -func Uint64Slice(src []uint64) []*uint64 { - dst := make([]*uint64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of -// uint64 values -func Uint64ValueSlice(src []*uint64) []uint64 { - dst := make([]uint64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint64Map converts a string map of uint64 values uinto a string -// map of uint64 pouinters -func Uint64Map(src map[string]uint64) map[string]*uint64 { - dst := make(map[string]*uint64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint64ValueMap converts a string map of uint64 pouinters uinto a string -// map of uint64 values -func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { - dst := make(map[string]uint64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float64 returns a pointer to of the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Value returns the value of the float64 pointer passed in or -// 0 if the pointer is nil. -func Float64Value(v *float64) float64 { - if v != nil { - return *v - } - return 0 -} - -// Float64Slice converts a slice of float64 values into a slice of -// float64 pointers -func Float64Slice(src []float64) []*float64 { - dst := make([]*float64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float64ValueSlice converts a slice of float64 pointers into a slice of -// float64 values -func Float64ValueSlice(src []*float64) []float64 { - dst := make([]float64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float64Map converts a string map of float64 values into a string -// map of float64 pointers -func Float64Map(src map[string]float64) map[string]*float64 { - dst := make(map[string]*float64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float64ValueMap converts a string map of float64 pointers into a string -// map of float64 values -func Float64ValueMap(src map[string]*float64) map[string]float64 { - dst := make(map[string]float64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Time returns a pointer to of the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeValue returns the value of the time.Time pointer passed in or -// time.Time{} if the pointer is nil. -func TimeValue(v *time.Time) time.Time { - if v != nil { - return *v - } - return time.Time{} -} - -// TimeSlice converts a slice of time.Time values into a slice of -// time.Time pointers -func TimeSlice(src []time.Time) []*time.Time { - dst := make([]*time.Time, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// TimeValueSlice converts a slice of time.Time pointers into a slice of -// time.Time values -func TimeValueSlice(src []*time.Time) []time.Time { - dst := make([]time.Time, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// TimeMap converts a string map of time.Time values into a string -// map of time.Time pointers -func TimeMap(src map[string]time.Time) map[string]*time.Time { - dst := make(map[string]*time.Time) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// TimeValueMap converts a string map of time.Time pointers into a string -// map of time.Time values -func TimeValueMap(src map[string]*time.Time) map[string]time.Time { - dst := make(map[string]time.Time) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} diff --git a/cmd/vendor/github.com/go-openapi/swag/json.go b/cmd/vendor/github.com/go-openapi/swag/json.go deleted file mode 100644 index cb20a6a0f7..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/json.go +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "bytes" - "encoding/json" - "log" - "reflect" - "strings" - "sync" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// DefaultJSONNameProvider the default cache for types -var DefaultJSONNameProvider = NewNameProvider() - -const comma = byte(',') - -var closers = map[byte]byte{ - '{': '}', - '[': ']', -} - -type ejMarshaler interface { - MarshalEasyJSON(w *jwriter.Writer) -} - -type ejUnmarshaler interface { - UnmarshalEasyJSON(w *jlexer.Lexer) -} - -// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaller -// so it takes the fastest option available. -func WriteJSON(data interface{}) ([]byte, error) { - if d, ok := data.(ejMarshaler); ok { - jw := new(jwriter.Writer) - d.MarshalEasyJSON(jw) - return jw.BuildBytes() - } - if d, ok := data.(json.Marshaler); ok { - return d.MarshalJSON() - } - return json.Marshal(data) -} - -// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller -// so it takes the fastes option available -func ReadJSON(data []byte, value interface{}) error { - if d, ok := value.(ejUnmarshaler); ok { - jl := &jlexer.Lexer{Data: data} - d.UnmarshalEasyJSON(jl) - return jl.Error() - } - if d, ok := value.(json.Unmarshaler); ok { - return d.UnmarshalJSON(data) - } - return json.Unmarshal(data, value) -} - -// DynamicJSONToStruct converts an untyped json structure into a struct -func DynamicJSONToStruct(data interface{}, target interface{}) error { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := WriteJSON(data) - if err != nil { - return err - } - if err := ReadJSON(b, target); err != nil { - return err - } - return nil -} - -// ConcatJSON concatenates multiple json objects efficiently -func ConcatJSON(blobs ...[]byte) []byte { - if len(blobs) == 0 { - return nil - } - if len(blobs) == 1 { - return blobs[0] - } - - last := len(blobs) - 1 - var opening, closing byte - a := 0 - idx := 0 - buf := bytes.NewBuffer(nil) - - for i, b := range blobs { - if len(b) > 0 && opening == 0 { // is this an array or an object? - opening, closing = b[0], closers[b[0]] - } - - if opening != '{' && opening != '[' { - continue // don't know how to concatenate non container objects - } - - if len(b) < 3 { // yep empty but also the last one, so closing this thing - if i == last && a > 0 { - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - continue - } - - idx = 0 - if a > 0 { // we need to join with a comma for everything beyond the first non-empty item - if err := buf.WriteByte(comma); err != nil { - log.Println(err) - } - idx = 1 // this is not the first or the last so we want to drop the leading bracket - } - - if i != last { // not the last one, strip brackets - if _, err := buf.Write(b[idx : len(b)-1]); err != nil { - log.Println(err) - } - } else { // last one, strip only the leading bracket - if _, err := buf.Write(b[idx:]); err != nil { - log.Println(err) - } - } - a++ - } - // somehow it ended up being empty, so provide a default value - if buf.Len() == 0 { - if err := buf.WriteByte(opening); err != nil { - log.Println(err) - } - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - return buf.Bytes() -} - -// ToDynamicJSON turns an object into a properly JSON typed structure -func ToDynamicJSON(data interface{}) interface{} { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - var res interface{} - if err := json.Unmarshal(b, &res); err != nil { - log.Println(err) - } - return res -} - -// FromDynamicJSON turns an object into a properly JSON typed structure -func FromDynamicJSON(data, target interface{}) error { - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - return json.Unmarshal(b, target) -} - -// NameProvider represents an object capabale of translating from go property names -// to json property names -// This type is thread-safe. -type NameProvider struct { - lock *sync.Mutex - index map[reflect.Type]nameIndex -} - -type nameIndex struct { - jsonNames map[string]string - goNames map[string]string -} - -// NewNameProvider creates a new name provider -func NewNameProvider() *NameProvider { - return &NameProvider{ - lock: &sync.Mutex{}, - index: make(map[reflect.Type]nameIndex), - } -} - -func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { - for i := 0; i < tpe.NumField(); i++ { - targetDes := tpe.Field(i) - - if targetDes.PkgPath != "" { // unexported - continue - } - - if targetDes.Anonymous { // walk embedded structures tree down first - buildnameIndex(targetDes.Type, idx, reverseIdx) - continue - } - - if tag := targetDes.Tag.Get("json"); tag != "" { - - parts := strings.Split(tag, ",") - if len(parts) == 0 { - continue - } - - nm := parts[0] - if nm == "-" { - continue - } - if nm == "" { // empty string means we want to use the Go name - nm = targetDes.Name - } - - idx[nm] = targetDes.Name - reverseIdx[targetDes.Name] = nm - } - } -} - -func newNameIndex(tpe reflect.Type) nameIndex { - var idx = make(map[string]string, tpe.NumField()) - var reverseIdx = make(map[string]string, tpe.NumField()) - - buildnameIndex(tpe, idx, reverseIdx) - return nameIndex{jsonNames: idx, goNames: reverseIdx} -} - -// GetJSONNames gets all the json property names for a type -func (n *NameProvider) GetJSONNames(subject interface{}) []string { - n.lock.Lock() - defer n.lock.Unlock() - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - - var res []string - for k := range names.jsonNames { - res = append(res, k) - } - return res -} - -// GetJSONName gets the json name for a go property name -func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetJSONNameForType(tpe, name) -} - -// GetJSONNameForType gets the json name for a go property name on a given type -func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.goNames[name] - return nme, ok -} - -func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex { - names := newNameIndex(tpe) - n.index[tpe] = names - return names -} - -// GetGoName gets the go name for a json property name -func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetGoNameForType(tpe, name) -} - -// GetGoNameForType gets the go name for a given type for a json property name -func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.jsonNames[name] - return nme, ok -} diff --git a/cmd/vendor/github.com/go-openapi/swag/loading.go b/cmd/vendor/github.com/go-openapi/swag/loading.go deleted file mode 100644 index 62ed1e80ab..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/loading.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "fmt" - "io/ioutil" - "log" - "net/http" - "path/filepath" - "strings" - "time" -) - -// LoadHTTPTimeout the default timeout for load requests -var LoadHTTPTimeout = 30 * time.Second - -// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in -func LoadFromFileOrHTTP(path string) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) -} - -// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in -// timeout arg allows for per request overriding of the request timeout -func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(timeout))(path) -} - -// LoadStrategy returns a loader function for a given path or uri -func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { - if strings.HasPrefix(path, "http") { - return remote - } - return func(pth string) ([]byte, error) { return local(filepath.FromSlash(pth)) } -} - -func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { - return func(path string) ([]byte, error) { - client := &http.Client{Timeout: timeout} - req, err := http.NewRequest("GET", path, nil) - if err != nil { - return nil, err - } - resp, err := client.Do(req) - defer func() { - if resp != nil { - if e := resp.Body.Close(); e != nil { - log.Println(e) - } - } - }() - if err != nil { - return nil, err - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) - } - - return ioutil.ReadAll(resp.Body) - } -} diff --git a/cmd/vendor/github.com/go-openapi/swag/net.go b/cmd/vendor/github.com/go-openapi/swag/net.go deleted file mode 100644 index 8323fa37b6..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/net.go +++ /dev/null @@ -1,24 +0,0 @@ -package swag - -import ( - "net" - "strconv" -) - -// SplitHostPort splits a network address into a host and a port. -// The port is -1 when there is no port to be found -func SplitHostPort(addr string) (host string, port int, err error) { - h, p, err := net.SplitHostPort(addr) - if err != nil { - return "", -1, err - } - if p == "" { - return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr} - } - - pi, err := strconv.Atoi(p) - if err != nil { - return "", -1, err - } - return h, pi, nil -} diff --git a/cmd/vendor/github.com/go-openapi/swag/path.go b/cmd/vendor/github.com/go-openapi/swag/path.go deleted file mode 100644 index 941bd0176b..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/path.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "os" - "path/filepath" - "runtime" - "strings" -) - -const ( - // GOPATHKey represents the env key for gopath - GOPATHKey = "GOPATH" -) - -// FindInSearchPath finds a package in a provided lists of paths -func FindInSearchPath(searchPath, pkg string) string { - pathsList := filepath.SplitList(searchPath) - for _, path := range pathsList { - if evaluatedPath, err := filepath.EvalSymlinks(filepath.Join(path, "src", pkg)); err == nil { - if _, err := os.Stat(evaluatedPath); err == nil { - return evaluatedPath - } - } - } - return "" -} - -// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT -func FindInGoSearchPath(pkg string) string { - return FindInSearchPath(FullGoSearchPath(), pkg) -} - -// FullGoSearchPath gets the search paths for finding packages -func FullGoSearchPath() string { - allPaths := os.Getenv(GOPATHKey) - if allPaths == "" { - allPaths = filepath.Join(os.Getenv("HOME"), "go") - } - if allPaths != "" { - allPaths = strings.Join([]string{allPaths, runtime.GOROOT()}, ":") - } else { - allPaths = runtime.GOROOT() - } - return allPaths -} diff --git a/cmd/vendor/github.com/go-openapi/swag/util.go b/cmd/vendor/github.com/go-openapi/swag/util.go deleted file mode 100644 index 7e0f80a411..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/util.go +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "math" - "reflect" - "regexp" - "sort" - "strings" - "sync" - "unicode" -) - -// Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769 -var commonInitialisms = map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTPS": true, - "HTTP": true, - "ID": true, - "IP": true, - "JSON": true, - "LHS": true, - "OAI": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, -} -var initialisms []string - -var once sync.Once - -func sortInitialisms() { - for k := range commonInitialisms { - initialisms = append(initialisms, k) - } - sort.Sort(sort.Reverse(byLength(initialisms))) -} - -// JoinByFormat joins a string array by a known format: -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -func JoinByFormat(data []string, format string) []string { - if len(data) == 0 { - return data - } - var sep string - switch format { - case "ssv": - sep = " " - case "tsv": - sep = "\t" - case "pipes": - sep = "|" - case "multi": - return data - default: - sep = "," - } - return []string{strings.Join(data, sep)} -} - -// SplitByFormat splits a string by a known format: -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -func SplitByFormat(data, format string) []string { - if data == "" { - return nil - } - var sep string - switch format { - case "ssv": - sep = " " - case "tsv": - sep = "\t" - case "pipes": - sep = "|" - case "multi": - return nil - default: - sep = "," - } - var result []string - for _, s := range strings.Split(data, sep) { - if ts := strings.TrimSpace(s); ts != "" { - result = append(result, ts) - } - } - return result -} - -type byLength []string - -func (s byLength) Len() int { - return len(s) -} -func (s byLength) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s byLength) Less(i, j int) bool { - return len(s[i]) < len(s[j]) -} - -// Prepares strings by splitting by caps, spaces, dashes, and underscore -func split(str string) (words []string) { - repl := strings.NewReplacer( - "@", "At ", - "&", "And ", - "|", "Pipe ", - "$", "Dollar ", - "!", "Bang ", - "-", " ", - "_", " ", - ) - - rex1 := regexp.MustCompile(`(\p{Lu})`) - rex2 := regexp.MustCompile(`(\pL|\pM|\pN|\p{Pc})+`) - - str = trim(str) - - // Convert dash and underscore to spaces - str = repl.Replace(str) - - // Split when uppercase is found (needed for Snake) - str = rex1.ReplaceAllString(str, " $1") - - // check if consecutive single char things make up an initialism - once.Do(sortInitialisms) - for _, k := range initialisms { - str = strings.Replace(str, rex1.ReplaceAllString(k, " $1"), " "+k, -1) - } - // Get the final list of words - words = rex2.FindAllString(str, -1) - - return -} - -// Removes leading whitespaces -func trim(str string) string { - return strings.Trim(str, " ") -} - -// Shortcut to strings.ToUpper() -func upper(str string) string { - return strings.ToUpper(trim(str)) -} - -// Shortcut to strings.ToLower() -func lower(str string) string { - return strings.ToLower(trim(str)) -} - -// Camelize an uppercased word -func Camelize(word string) (camelized string) { - for pos, ru := range word { - if pos > 0 { - camelized += string(unicode.ToLower(ru)) - } else { - camelized += string(unicode.ToUpper(ru)) - } - } - return -} - -// ToFileName lowercases and underscores a go type name -func ToFileName(name string) string { - var out []string - - for _, w := range split(name) { - out = append(out, lower(w)) - } - - return strings.Join(out, "_") -} - -// ToCommandName lowercases and underscores a go type name -func ToCommandName(name string) string { - var out []string - for _, w := range split(name) { - out = append(out, lower(w)) - } - return strings.Join(out, "-") -} - -// ToHumanNameLower represents a code name as a human series of words -func ToHumanNameLower(name string) string { - var out []string - for _, w := range split(name) { - if !commonInitialisms[upper(w)] { - out = append(out, lower(w)) - } else { - out = append(out, w) - } - } - return strings.Join(out, " ") -} - -// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized -func ToHumanNameTitle(name string) string { - var out []string - for _, w := range split(name) { - uw := upper(w) - if !commonInitialisms[uw] { - out = append(out, upper(w[:1])+lower(w[1:])) - } else { - out = append(out, w) - } - } - return strings.Join(out, " ") -} - -// ToJSONName camelcases a name which can be underscored or pascal cased -func ToJSONName(name string) string { - var out []string - for i, w := range split(name) { - if i == 0 { - out = append(out, lower(w)) - continue - } - out = append(out, upper(w[:1])+lower(w[1:])) - } - return strings.Join(out, "") -} - -// ToVarName camelcases a name which can be underscored or pascal cased -func ToVarName(name string) string { - res := ToGoName(name) - if _, ok := commonInitialisms[res]; ok { - return lower(res) - } - if len(res) <= 1 { - return lower(res) - } - return lower(res[:1]) + res[1:] -} - -// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes -func ToGoName(name string) string { - var out []string - for _, w := range split(name) { - uw := upper(w) - mod := int(math.Min(float64(len(uw)), 2)) - if !commonInitialisms[uw] && !commonInitialisms[uw[:len(uw)-mod]] { - uw = upper(w[:1]) + lower(w[1:]) - } - out = append(out, uw) - } - - result := strings.Join(out, "") - if len(result) > 0 { - ud := upper(result[:1]) - ru := []rune(ud) - if unicode.IsUpper(ru[0]) { - result = ud + result[1:] - } else { - result = "X" + ud + result[1:] - } - } - return result -} - -// ContainsStringsCI searches a slice of strings for a case-insensitive match -func ContainsStringsCI(coll []string, item string) bool { - for _, a := range coll { - if strings.EqualFold(a, item) { - return true - } - } - return false -} - -type zeroable interface { - IsZero() bool -} - -// IsZero returns true when the value passed into the function is a zero value. -// This allows for safer checking of interface values. -func IsZero(data interface{}) bool { - // check for things that have an IsZero method instead - if vv, ok := data.(zeroable); ok { - return vv.IsZero() - } - // continue with slightly more complex reflection - v := reflect.ValueOf(data) - switch v.Kind() { - case 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.Map, reflect.Ptr, reflect.Slice: - return v.IsNil() - case reflect.Struct, reflect.Array: - return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface()) - case reflect.Invalid: - return true - } - return false -} - -// AddInitialisms add additional initialisms -func AddInitialisms(words ...string) { - for _, word := range words { - commonInitialisms[upper(word)] = true - } -} - -// CommandLineOptionsGroup represents a group of user-defined command line options -type CommandLineOptionsGroup struct { - ShortDescription string - LongDescription string - Options interface{} -} diff --git a/cmd/vendor/github.com/go-openapi/swag/yaml.go b/cmd/vendor/github.com/go-openapi/swag/yaml.go deleted file mode 100644 index 26502f21d5..0000000000 --- a/cmd/vendor/github.com/go-openapi/swag/yaml.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "encoding/json" - "fmt" - "path/filepath" - "strconv" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" - - yaml "gopkg.in/yaml.v2" -) - -// YAMLMatcher matches yaml -func YAMLMatcher(path string) bool { - ext := filepath.Ext(path) - return ext == ".yaml" || ext == ".yml" -} - -// YAMLToJSON converts YAML unmarshaled data into json compatible data -func YAMLToJSON(data interface{}) (json.RawMessage, error) { - jm, err := transformData(data) - if err != nil { - return nil, err - } - b, err := WriteJSON(jm) - return json.RawMessage(b), err -} - -func BytesToYAMLDoc(data []byte) (interface{}, error) { - var canary map[interface{}]interface{} // validate this is an object and not a different type - if err := yaml.Unmarshal(data, &canary); err != nil { - return nil, err - } - - var document yaml.MapSlice // preserve order that is present in the document - if err := yaml.Unmarshal(data, &document); err != nil { - return nil, err - } - return document, nil -} - -type JSONMapSlice []JSONMapItem - -func (s JSONMapSlice) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) { - w.RawByte('{') - - ln := len(s) - last := ln - 1 - for i := 0; i < ln; i++ { - s[i].MarshalEasyJSON(w) - if i != last { // last item - w.RawByte(',') - } - } - - w.RawByte('}') -} - -func (s *JSONMapSlice) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} -func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) { - if in.IsNull() { - in.Skip() - return - } - - var result JSONMapSlice - in.Delim('{') - for !in.IsDelim('}') { - var mi JSONMapItem - mi.UnmarshalEasyJSON(in) - result = append(result, mi) - } - *s = result -} - -type JSONMapItem struct { - Key string - Value interface{} -} - -func (s JSONMapItem) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) { - w.String(s.Key) - w.RawByte(':') - w.Raw(WriteJSON(s.Value)) -} - -func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) { - key := in.UnsafeString() - in.WantColon() - value := in.Interface() - in.WantComma() - s.Key = key - s.Value = value -} -func (s *JSONMapItem) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -func transformData(input interface{}) (out interface{}, err error) { - switch in := input.(type) { - case yaml.MapSlice: - - o := make(JSONMapSlice, len(in)) - for i, mi := range in { - var nmi JSONMapItem - switch k := mi.Key.(type) { - case string: - nmi.Key = k - case int: - nmi.Key = strconv.Itoa(k) - default: - return nil, fmt.Errorf("types don't match expect map key string or int got: %T", mi.Key) - } - - v, err := transformData(mi.Value) - if err != nil { - return nil, err - } - nmi.Value = v - o[i] = nmi - } - return o, nil - case map[interface{}]interface{}: - o := make(JSONMapSlice, 0, len(in)) - for ke, va := range in { - var nmi JSONMapItem - switch k := ke.(type) { - case string: - nmi.Key = k - case int: - nmi.Key = strconv.Itoa(k) - default: - return nil, fmt.Errorf("types don't match expect map key string or int got: %T", ke) - } - - v, err := transformData(va) - if err != nil { - return nil, err - } - nmi.Value = v - o = append(o, nmi) - } - return o, nil - case []interface{}: - len1 := len(in) - o := make([]interface{}, len1) - for i := 0; i < len1; i++ { - o[i], err = transformData(in[i]) - if err != nil { - return nil, err - } - } - return o, nil - } - return input, nil -} - -// YAMLDoc loads a yaml document from either http or a file and converts it to json -func YAMLDoc(path string) (json.RawMessage, error) { - yamlDoc, err := YAMLData(path) - if err != nil { - return nil, err - } - - data, err := YAMLToJSON(yamlDoc) - if err != nil { - return nil, err - } - - return json.RawMessage(data), nil -} - -// YAMLData loads a yaml document from either http or a file -func YAMLData(path string) (interface{}, error) { - data, err := LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - - return BytesToYAMLDoc(data) -} diff --git a/cmd/vendor/github.com/gobuffalo/envy/envy.go b/cmd/vendor/github.com/gobuffalo/envy/envy.go index 0e23a9483b..f82236c94d 100644 --- a/cmd/vendor/github.com/gobuffalo/envy/envy.go +++ b/cmd/vendor/github.com/gobuffalo/envy/envy.go @@ -1,35 +1,58 @@ package envy import ( + "flag" "fmt" "os" + "os/exec" "path/filepath" "runtime" + "strconv" "strings" "sync" "github.com/joho/godotenv" - homedir "github.com/mitchellh/go-homedir" ) var gil = &sync.Mutex{} var env = map[string]string{} func init() { + Load() loadEnv() } // Load the ENV variables to the env map func loadEnv() { - v := runtime.Version() + // Detect the Go version on the user system, not the one that was used to compile the binary + v := "" + out, err := exec.Command("go", "version").Output() + if err == nil { + // This will break when Go 2 lands + v = strings.Split(string(out), " ")[2][4:] + } else { + v = runtime.Version()[4:] + } + + goRuntimeVersion, _ := strconv.ParseFloat(runtime.Version()[4:], 64) + + goVersion, err := strconv.ParseFloat(v, 64) + if err != nil { + goVersion = goRuntimeVersion + } + + if os.Getenv("GO_ENV") == "" { + if flag.Lookup("test.v") != nil { + Set("GO_ENV", "test") + } + } + // set the GOPATH if using >= 1.8 and the GOPATH isn't set - if v >= "go1.8" && os.Getenv("GOPATH") == "" { - home, err := homedir.Dir() + if goVersion >= 8 && os.Getenv("GOPATH") == "" { + out, err := exec.Command("go", "env", "GOPATH").Output() if err == nil { - home, err := homedir.Expand(home) - if err == nil { - os.Setenv("GOPATH", filepath.Join(home, "go")) - } + gp := strings.TrimSpace(string(out)) + os.Setenv("GOPATH", gp) } } @@ -149,18 +172,7 @@ func Temp(f func()) { } func GoPath() string { - root, _ := os.Getwd() - paths := GoPaths() - - for i := 0; i < len(paths); i++ { - if strings.HasPrefix(root, filepath.Join(paths[i], "src")) { - return paths[i] - } - } - if len(paths) > 0 { - return paths[0] - } - return "" + return Get("GOPATH", "") } // GoPaths returns all possible GOPATHS that are set. @@ -172,19 +184,30 @@ func GoPaths() []string { return strings.Split(gp, ":") } +func importPath(path string) string { + for _, gopath := range GoPaths() { + srcpath := filepath.Join(gopath, "src") + rel, err := filepath.Rel(srcpath, path) + if err == nil { + return filepath.ToSlash(rel) + } + } + + // fallback to trim + rel := strings.TrimPrefix(path, filepath.Join(GoPath(), "src")) + rel = strings.TrimPrefix(rel, string(filepath.Separator)) + return filepath.ToSlash(rel) +} + func CurrentPackage() string { pwd, _ := os.Getwd() - for _, gp := range GoPaths() { - pwd = strings.TrimPrefix(pwd, filepath.Join(gp, "src")) - } - pwd = strings.TrimPrefix(pwd, string(os.PathSeparator)) - return filepath.ToSlash(pwd) + return importPath(pwd) } func Environ() []string { gil.Lock() defer gil.Unlock() - e := []string{} + var e []string for k, v := range env { e = append(e, fmt.Sprintf("%s=%s", k, v)) } diff --git a/cmd/vendor/github.com/mailru/easyjson/LICENSE b/cmd/vendor/github.com/mailru/easyjson/LICENSE deleted file mode 100644 index fbff658f70..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2016 Mail.Ru Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/cmd/vendor/github.com/mailru/easyjson/benchmark/data.go b/cmd/vendor/github.com/mailru/easyjson/benchmark/data.go deleted file mode 100644 index 71eb91a94c..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/benchmark/data.go +++ /dev/null @@ -1,148 +0,0 @@ -// Package benchmark provides a simple benchmark for easyjson against default serialization and ffjson. -// The data example is taken from https://dev.twitter.com/rest/reference/get/search/tweets -package benchmark - -import ( - "io/ioutil" -) - -var largeStructText, _ = ioutil.ReadFile("example.json") -var xlStructData XLStruct - -func init() { - for i := 0; i < 50; i++ { - xlStructData.Data = append(xlStructData.Data, largeStructData) - } -} - -var smallStructText = []byte(`{"hashtags":[{"indices":[5, 10],"text":"some-text"}],"urls":[],"user_mentions":[]}`) -var smallStructData = Entities{ - Hashtags: []Hashtag{{Indices: []int{5, 10}, Text: "some-text"}}, - Urls: []*string{}, - UserMentions: []*string{}, -} - -type SearchMetadata struct { - CompletedIn float64 `json:"completed_in"` - Count int `json:"count"` - MaxID int64 `json:"max_id"` - MaxIDStr string `json:"max_id_str"` - NextResults string `json:"next_results"` - Query string `json:"query"` - RefreshURL string `json:"refresh_url"` - SinceID int64 `json:"since_id"` - SinceIDStr string `json:"since_id_str"` -} - -type Hashtag struct { - Indices []int `json:"indices"` - Text string `json:"text"` -} - -//easyjson:json -type Entities struct { - Hashtags []Hashtag `json:"hashtags"` - Urls []*string `json:"urls"` - UserMentions []*string `json:"user_mentions"` -} - -type UserEntityDescription struct { - Urls []*string `json:"urls"` -} - -type URL struct { - ExpandedURL *string `json:"expanded_url"` - Indices []int `json:"indices"` - URL string `json:"url"` -} - -type UserEntityURL struct { - Urls []URL `json:"urls"` -} - -type UserEntities struct { - Description UserEntityDescription `json:"description"` - URL UserEntityURL `json:"url"` -} - -type User struct { - ContributorsEnabled bool `json:"contributors_enabled"` - CreatedAt string `json:"created_at"` - DefaultProfile bool `json:"default_profile"` - DefaultProfileImage bool `json:"default_profile_image"` - Description string `json:"description"` - Entities UserEntities `json:"entities"` - FavouritesCount int `json:"favourites_count"` - FollowRequestSent *string `json:"follow_request_sent"` - FollowersCount int `json:"followers_count"` - Following *string `json:"following"` - FriendsCount int `json:"friends_count"` - GeoEnabled bool `json:"geo_enabled"` - ID int `json:"id"` - IDStr string `json:"id_str"` - IsTranslator bool `json:"is_translator"` - Lang string `json:"lang"` - ListedCount int `json:"listed_count"` - Location string `json:"location"` - Name string `json:"name"` - Notifications *string `json:"notifications"` - ProfileBackgroundColor string `json:"profile_background_color"` - ProfileBackgroundImageURL string `json:"profile_background_image_url"` - ProfileBackgroundImageURLHTTPS string `json:"profile_background_image_url_https"` - ProfileBackgroundTile bool `json:"profile_background_tile"` - ProfileImageURL string `json:"profile_image_url"` - ProfileImageURLHTTPS string `json:"profile_image_url_https"` - ProfileLinkColor string `json:"profile_link_color"` - ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` - ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` - ProfileTextColor string `json:"profile_text_color"` - ProfileUseBackgroundImage bool `json:"profile_use_background_image"` - Protected bool `json:"protected"` - ScreenName string `json:"screen_name"` - ShowAllInlineMedia bool `json:"show_all_inline_media"` - StatusesCount int `json:"statuses_count"` - TimeZone string `json:"time_zone"` - URL *string `json:"url"` - UtcOffset int `json:"utc_offset"` - Verified bool `json:"verified"` -} - -type StatusMetadata struct { - IsoLanguageCode string `json:"iso_language_code"` - ResultType string `json:"result_type"` -} - -type Status struct { - Contributors *string `json:"contributors"` - Coordinates *string `json:"coordinates"` - CreatedAt string `json:"created_at"` - Entities Entities `json:"entities"` - Favorited bool `json:"favorited"` - Geo *string `json:"geo"` - ID int64 `json:"id"` - IDStr string `json:"id_str"` - InReplyToScreenName *string `json:"in_reply_to_screen_name"` - InReplyToStatusID *string `json:"in_reply_to_status_id"` - InReplyToStatusIDStr *string `json:"in_reply_to_status_id_str"` - InReplyToUserID *string `json:"in_reply_to_user_id"` - InReplyToUserIDStr *string `json:"in_reply_to_user_id_str"` - Metadata StatusMetadata `json:"metadata"` - Place *string `json:"place"` - RetweetCount int `json:"retweet_count"` - Retweeted bool `json:"retweeted"` - Source string `json:"source"` - Text string `json:"text"` - Truncated bool `json:"truncated"` - User User `json:"user"` -} - -//easyjson:json -type LargeStruct struct { - SearchMetadata SearchMetadata `json:"search_metadata"` - Statuses []Status `json:"statuses"` -} - -//easyjson:json -type XLStruct struct { - Data []LargeStruct -} diff --git a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_codec.go b/cmd/vendor/github.com/mailru/easyjson/benchmark/data_codec.go deleted file mode 100644 index d2d83fac63..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_codec.go +++ /dev/null @@ -1,6914 +0,0 @@ -//+build use_codec -//+build !easyjson_nounsafe -//+build !appengine - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package benchmark - -import ( - "errors" - "fmt" - "reflect" - "runtime" - "unsafe" - - codec1978 "github.com/ugorji/go/codec" -) - -const ( - // ----- content types ---- - codecSelferC_UTF89225 = 1 - codecSelferC_RAW9225 = 0 - // ----- value types used ---- - codecSelferValueTypeArray9225 = 10 - codecSelferValueTypeMap9225 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey9225 = 2 - codecSelfer_containerMapValue9225 = 3 - codecSelfer_containerMapEnd9225 = 4 - codecSelfer_containerArrayElem9225 = 6 - codecSelfer_containerArrayEnd9225 = 7 -) - -var ( - codecSelferBitsize9225 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr9225 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelferUnsafeString9225 struct { - Data uintptr - Len int -} - -type codecSelfer9225 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 unsafe.Pointer - _ = v0 - } -} - -func (x *SearchMetadata) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [9]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(9) - } else { - yynn2 = 9 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeFloat64(float64(x.CompletedIn)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("completed_in")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeFloat64(float64(x.CompletedIn)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.MaxID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("max_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.MaxID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.MaxIDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("max_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.MaxIDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.NextResults)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("next_results")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.NextResults)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Query)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("query")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Query)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.RefreshURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("refresh_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.RefreshURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.SinceID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("since_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeInt(int64(x.SinceID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.SinceIDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("since_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.SinceIDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *SearchMetadata) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *SearchMetadata) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "completed_in": - if r.TryDecodeAsNil() { - x.CompletedIn = 0 - } else { - yyv4 := &x.CompletedIn - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*float64)(yyv4)) = float64(r.DecodeFloat(false)) - } - } - case "count": - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv6 := &x.Count - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "max_id": - if r.TryDecodeAsNil() { - x.MaxID = 0 - } else { - yyv8 := &x.MaxID - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "max_id_str": - if r.TryDecodeAsNil() { - x.MaxIDStr = "" - } else { - yyv10 := &x.MaxIDStr - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "next_results": - if r.TryDecodeAsNil() { - x.NextResults = "" - } else { - yyv12 := &x.NextResults - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "query": - if r.TryDecodeAsNil() { - x.Query = "" - } else { - yyv14 := &x.Query - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - case "refresh_url": - if r.TryDecodeAsNil() { - x.RefreshURL = "" - } else { - yyv16 := &x.RefreshURL - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "since_id": - if r.TryDecodeAsNil() { - x.SinceID = 0 - } else { - yyv18 := &x.SinceID - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int)(yyv18)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "since_id_str": - if r.TryDecodeAsNil() { - x.SinceIDStr = "" - } else { - yyv20 := &x.SinceIDStr - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *SearchMetadata) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj22 int - var yyb22 bool - var yyhl22 bool = l >= 0 - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CompletedIn = 0 - } else { - yyv23 := &x.CompletedIn - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*float64)(yyv23)) = float64(r.DecodeFloat(false)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv25 := &x.Count - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*int)(yyv25)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.MaxID = 0 - } else { - yyv27 := &x.MaxID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.MaxIDStr = "" - } else { - yyv29 := &x.MaxIDStr - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.NextResults = "" - } else { - yyv31 := &x.NextResults - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Query = "" - } else { - yyv33 := &x.Query - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.RefreshURL = "" - } else { - yyv35 := &x.RefreshURL - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SinceID = 0 - } else { - yyv37 := &x.SinceID - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*int)(yyv37)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SinceIDStr = "" - } else { - yyv39 := &x.SinceIDStr - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - for { - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj22-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Hashtag) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("indices")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("text")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Hashtag) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Hashtag) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "indices": - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv4 := &x.Indices - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceIntX(yyv4, false, d) - } - } - case "text": - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv6 := &x.Text - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Hashtag) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv9 := &x.Indices - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - z.F.DecSliceIntX(yyv9, false, d) - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv11 := &x.Text - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Entities) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Hashtags == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceHashtag(([]Hashtag)(x.Hashtags), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("hashtags")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Hashtags == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceHashtag(([]Hashtag)(x.Hashtags), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.UserMentions == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.UserMentions), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("user_mentions")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.UserMentions == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.UserMentions), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Entities) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Entities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "hashtags": - if r.TryDecodeAsNil() { - x.Hashtags = nil - } else { - yyv4 := &x.Hashtags - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceHashtag((*[]Hashtag)(yyv4), d) - } - } - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv6 := &x.Urls - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv6), d) - } - } - case "user_mentions": - if r.TryDecodeAsNil() { - x.UserMentions = nil - } else { - yyv8 := &x.UserMentions - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv8), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Entities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Hashtags = nil - } else { - yyv11 := &x.Hashtags - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - h.decSliceHashtag((*[]Hashtag)(yyv11), d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv13 := &x.Urls - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv13), d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.UserMentions = nil - } else { - yyv15 := &x.UserMentions - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv15), d) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntityDescription) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntityDescription) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntityDescription) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv4 := &x.Urls - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntityDescription) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv7 := &x.Urls - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *URL) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.ExpandedURL == nil { - r.EncodeNil() - } else { - yy4 := *x.ExpandedURL - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy4)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("expanded_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.ExpandedURL == nil { - r.EncodeNil() - } else { - yy6 := *x.ExpandedURL - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy6)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym9 := z.EncBinary() - _ = yym9 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("indices")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym12 := z.EncBinary() - _ = yym12 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.URL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.URL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *URL) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *URL) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "expanded_url": - if r.TryDecodeAsNil() { - if x.ExpandedURL != nil { - x.ExpandedURL = nil - } - } else { - if x.ExpandedURL == nil { - x.ExpandedURL = new(string) - } - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(x.ExpandedURL)) = r.DecodeString() - } - } - case "indices": - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv6 := &x.Indices - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceIntX(yyv6, false, d) - } - } - case "url": - if r.TryDecodeAsNil() { - x.URL = "" - } else { - yyv8 := &x.URL - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *URL) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.ExpandedURL != nil { - x.ExpandedURL = nil - } - } else { - if x.ExpandedURL == nil { - x.ExpandedURL = new(string) - } - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(x.ExpandedURL)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv13 := &x.Indices - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceIntX(yyv13, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.URL = "" - } else { - yyv15 := &x.URL - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntityURL) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceURL(([]URL)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceURL(([]URL)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntityURL) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntityURL) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv4 := &x.Urls - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceURL((*[]URL)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntityURL) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv7 := &x.Urls - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSliceURL((*[]URL)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntities) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy4 := &x.Description - yy4.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("description")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy6 := &x.Description - yy6.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy9 := &x.URL - yy9.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy11 := &x.URL - yy11.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntities) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "description": - if r.TryDecodeAsNil() { - x.Description = UserEntityDescription{} - } else { - yyv4 := &x.Description - yyv4.CodecDecodeSelf(d) - } - case "url": - if r.TryDecodeAsNil() { - x.URL = UserEntityURL{} - } else { - yyv5 := &x.URL - yyv5.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Description = UserEntityDescription{} - } else { - yyv7 := &x.Description - yyv7.CodecDecodeSelf(d) - } - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.URL = UserEntityURL{} - } else { - yyv8 := &x.URL - yyv8.CodecDecodeSelf(d) - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *User) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [39]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(39) - } else { - yynn2 = 39 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.ContributorsEnabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("contributors_enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.ContributorsEnabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("created_at")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("default_profile")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfile)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfileImage)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("default_profile_image")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfileImage)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Description)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("description")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Description)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy19 := &x.Entities - yy19.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("entities")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy21 := &x.Entities - yy21.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym24 := z.EncBinary() - _ = yym24 - if false { - } else { - r.EncodeInt(int64(x.FavouritesCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("favourites_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.FavouritesCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.FollowRequestSent == nil { - r.EncodeNil() - } else { - yy27 := *x.FollowRequestSent - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy27)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("follow_request_sent")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.FollowRequestSent == nil { - r.EncodeNil() - } else { - yy29 := *x.FollowRequestSent - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy29)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeInt(int64(x.FollowersCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("followers_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeInt(int64(x.FollowersCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Following == nil { - r.EncodeNil() - } else { - yy35 := *x.Following - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy35)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("following")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Following == nil { - r.EncodeNil() - } else { - yy37 := *x.Following - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy37)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeInt(int64(x.FriendsCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("friends_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeInt(int64(x.FriendsCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeBool(bool(x.GeoEnabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("geo_enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeBool(bool(x.GeoEnabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeBool(bool(x.IsTranslator)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("is_translator")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeBool(bool(x.IsTranslator)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Lang)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("lang")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Lang)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeInt(int64(x.ListedCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("listed_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeInt(int64(x.ListedCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Location)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("location")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym62 := z.EncBinary() - _ = yym62 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Location)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym65 := z.EncBinary() - _ = yym65 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Notifications == nil { - r.EncodeNil() - } else { - yy67 := *x.Notifications - yym68 := z.EncBinary() - _ = yym68 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy67)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("notifications")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Notifications == nil { - r.EncodeNil() - } else { - yy69 := *x.Notifications - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy69)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym73 := z.EncBinary() - _ = yym73 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_image_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym76 := z.EncBinary() - _ = yym76 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym78 := z.EncBinary() - _ = yym78 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURLHTTPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_image_url_https")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym79 := z.EncBinary() - _ = yym79 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURLHTTPS)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - r.EncodeBool(bool(x.ProfileBackgroundTile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_tile")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym82 := z.EncBinary() - _ = yym82 - if false { - } else { - r.EncodeBool(bool(x.ProfileBackgroundTile)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_image_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym85 := z.EncBinary() - _ = yym85 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURLHTTPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_image_url_https")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym88 := z.EncBinary() - _ = yym88 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURLHTTPS)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym90 := z.EncBinary() - _ = yym90 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileLinkColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_link_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym91 := z.EncBinary() - _ = yym91 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileLinkColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym93 := z.EncBinary() - _ = yym93 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarBorderColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_sidebar_border_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym94 := z.EncBinary() - _ = yym94 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarBorderColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym96 := z.EncBinary() - _ = yym96 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarFillColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_sidebar_fill_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym97 := z.EncBinary() - _ = yym97 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarFillColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym99 := z.EncBinary() - _ = yym99 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileTextColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_text_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym100 := z.EncBinary() - _ = yym100 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileTextColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym102 := z.EncBinary() - _ = yym102 - if false { - } else { - r.EncodeBool(bool(x.ProfileUseBackgroundImage)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_use_background_image")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym103 := z.EncBinary() - _ = yym103 - if false { - } else { - r.EncodeBool(bool(x.ProfileUseBackgroundImage)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym105 := z.EncBinary() - _ = yym105 - if false { - } else { - r.EncodeBool(bool(x.Protected)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("protected")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym106 := z.EncBinary() - _ = yym106 - if false { - } else { - r.EncodeBool(bool(x.Protected)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym108 := z.EncBinary() - _ = yym108 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ScreenName)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("screen_name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym109 := z.EncBinary() - _ = yym109 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ScreenName)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym111 := z.EncBinary() - _ = yym111 - if false { - } else { - r.EncodeBool(bool(x.ShowAllInlineMedia)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("show_all_inline_media")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym112 := z.EncBinary() - _ = yym112 - if false { - } else { - r.EncodeBool(bool(x.ShowAllInlineMedia)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym114 := z.EncBinary() - _ = yym114 - if false { - } else { - r.EncodeInt(int64(x.StatusesCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("statuses_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym115 := z.EncBinary() - _ = yym115 - if false { - } else { - r.EncodeInt(int64(x.StatusesCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym117 := z.EncBinary() - _ = yym117 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.TimeZone)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("time_zone")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym118 := z.EncBinary() - _ = yym118 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.TimeZone)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.URL == nil { - r.EncodeNil() - } else { - yy120 := *x.URL - yym121 := z.EncBinary() - _ = yym121 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy120)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.URL == nil { - r.EncodeNil() - } else { - yy122 := *x.URL - yym123 := z.EncBinary() - _ = yym123 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy122)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym125 := z.EncBinary() - _ = yym125 - if false { - } else { - r.EncodeInt(int64(x.UtcOffset)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("utc_offset")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym126 := z.EncBinary() - _ = yym126 - if false { - } else { - r.EncodeInt(int64(x.UtcOffset)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym128 := z.EncBinary() - _ = yym128 - if false { - } else { - r.EncodeBool(bool(x.Verified)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("verified")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym129 := z.EncBinary() - _ = yym129 - if false { - } else { - r.EncodeBool(bool(x.Verified)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *User) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *User) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "contributors_enabled": - if r.TryDecodeAsNil() { - x.ContributorsEnabled = false - } else { - yyv4 := &x.ContributorsEnabled - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "created_at": - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv6 := &x.CreatedAt - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "default_profile": - if r.TryDecodeAsNil() { - x.DefaultProfile = false - } else { - yyv8 := &x.DefaultProfile - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "default_profile_image": - if r.TryDecodeAsNil() { - x.DefaultProfileImage = false - } else { - yyv10 := &x.DefaultProfileImage - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "description": - if r.TryDecodeAsNil() { - x.Description = "" - } else { - yyv12 := &x.Description - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "entities": - if r.TryDecodeAsNil() { - x.Entities = UserEntities{} - } else { - yyv14 := &x.Entities - yyv14.CodecDecodeSelf(d) - } - case "favourites_count": - if r.TryDecodeAsNil() { - x.FavouritesCount = 0 - } else { - yyv15 := &x.FavouritesCount - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int)(yyv15)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "follow_request_sent": - if r.TryDecodeAsNil() { - if x.FollowRequestSent != nil { - x.FollowRequestSent = nil - } - } else { - if x.FollowRequestSent == nil { - x.FollowRequestSent = new(string) - } - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(x.FollowRequestSent)) = r.DecodeString() - } - } - case "followers_count": - if r.TryDecodeAsNil() { - x.FollowersCount = 0 - } else { - yyv19 := &x.FollowersCount - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*int)(yyv19)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "following": - if r.TryDecodeAsNil() { - if x.Following != nil { - x.Following = nil - } - } else { - if x.Following == nil { - x.Following = new(string) - } - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(x.Following)) = r.DecodeString() - } - } - case "friends_count": - if r.TryDecodeAsNil() { - x.FriendsCount = 0 - } else { - yyv23 := &x.FriendsCount - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*int)(yyv23)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "geo_enabled": - if r.TryDecodeAsNil() { - x.GeoEnabled = false - } else { - yyv25 := &x.GeoEnabled - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - case "id": - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv27 := &x.ID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "id_str": - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv29 := &x.IDStr - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - case "is_translator": - if r.TryDecodeAsNil() { - x.IsTranslator = false - } else { - yyv31 := &x.IsTranslator - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*bool)(yyv31)) = r.DecodeBool() - } - } - case "lang": - if r.TryDecodeAsNil() { - x.Lang = "" - } else { - yyv33 := &x.Lang - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - case "listed_count": - if r.TryDecodeAsNil() { - x.ListedCount = 0 - } else { - yyv35 := &x.ListedCount - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*int)(yyv35)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "location": - if r.TryDecodeAsNil() { - x.Location = "" - } else { - yyv37 := &x.Location - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv39 := &x.Name - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - case "notifications": - if r.TryDecodeAsNil() { - if x.Notifications != nil { - x.Notifications = nil - } - } else { - if x.Notifications == nil { - x.Notifications = new(string) - } - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*string)(x.Notifications)) = r.DecodeString() - } - } - case "profile_background_color": - if r.TryDecodeAsNil() { - x.ProfileBackgroundColor = "" - } else { - yyv43 := &x.ProfileBackgroundColor - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*string)(yyv43)) = r.DecodeString() - } - } - case "profile_background_image_url": - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURL = "" - } else { - yyv45 := &x.ProfileBackgroundImageURL - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*string)(yyv45)) = r.DecodeString() - } - } - case "profile_background_image_url_https": - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURLHTTPS = "" - } else { - yyv47 := &x.ProfileBackgroundImageURLHTTPS - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*string)(yyv47)) = r.DecodeString() - } - } - case "profile_background_tile": - if r.TryDecodeAsNil() { - x.ProfileBackgroundTile = false - } else { - yyv49 := &x.ProfileBackgroundTile - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*bool)(yyv49)) = r.DecodeBool() - } - } - case "profile_image_url": - if r.TryDecodeAsNil() { - x.ProfileImageURL = "" - } else { - yyv51 := &x.ProfileImageURL - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*string)(yyv51)) = r.DecodeString() - } - } - case "profile_image_url_https": - if r.TryDecodeAsNil() { - x.ProfileImageURLHTTPS = "" - } else { - yyv53 := &x.ProfileImageURLHTTPS - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*string)(yyv53)) = r.DecodeString() - } - } - case "profile_link_color": - if r.TryDecodeAsNil() { - x.ProfileLinkColor = "" - } else { - yyv55 := &x.ProfileLinkColor - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*string)(yyv55)) = r.DecodeString() - } - } - case "profile_sidebar_border_color": - if r.TryDecodeAsNil() { - x.ProfileSidebarBorderColor = "" - } else { - yyv57 := &x.ProfileSidebarBorderColor - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - case "profile_sidebar_fill_color": - if r.TryDecodeAsNil() { - x.ProfileSidebarFillColor = "" - } else { - yyv59 := &x.ProfileSidebarFillColor - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(yyv59)) = r.DecodeString() - } - } - case "profile_text_color": - if r.TryDecodeAsNil() { - x.ProfileTextColor = "" - } else { - yyv61 := &x.ProfileTextColor - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*string)(yyv61)) = r.DecodeString() - } - } - case "profile_use_background_image": - if r.TryDecodeAsNil() { - x.ProfileUseBackgroundImage = false - } else { - yyv63 := &x.ProfileUseBackgroundImage - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*bool)(yyv63)) = r.DecodeBool() - } - } - case "protected": - if r.TryDecodeAsNil() { - x.Protected = false - } else { - yyv65 := &x.Protected - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*bool)(yyv65)) = r.DecodeBool() - } - } - case "screen_name": - if r.TryDecodeAsNil() { - x.ScreenName = "" - } else { - yyv67 := &x.ScreenName - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(yyv67)) = r.DecodeString() - } - } - case "show_all_inline_media": - if r.TryDecodeAsNil() { - x.ShowAllInlineMedia = false - } else { - yyv69 := &x.ShowAllInlineMedia - yym70 := z.DecBinary() - _ = yym70 - if false { - } else { - *((*bool)(yyv69)) = r.DecodeBool() - } - } - case "statuses_count": - if r.TryDecodeAsNil() { - x.StatusesCount = 0 - } else { - yyv71 := &x.StatusesCount - yym72 := z.DecBinary() - _ = yym72 - if false { - } else { - *((*int)(yyv71)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "time_zone": - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv73 := &x.TimeZone - yym74 := z.DecBinary() - _ = yym74 - if false { - } else { - *((*string)(yyv73)) = r.DecodeString() - } - } - case "url": - if r.TryDecodeAsNil() { - if x.URL != nil { - x.URL = nil - } - } else { - if x.URL == nil { - x.URL = new(string) - } - yym76 := z.DecBinary() - _ = yym76 - if false { - } else { - *((*string)(x.URL)) = r.DecodeString() - } - } - case "utc_offset": - if r.TryDecodeAsNil() { - x.UtcOffset = 0 - } else { - yyv77 := &x.UtcOffset - yym78 := z.DecBinary() - _ = yym78 - if false { - } else { - *((*int)(yyv77)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "verified": - if r.TryDecodeAsNil() { - x.Verified = false - } else { - yyv79 := &x.Verified - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*bool)(yyv79)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *User) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj81 int - var yyb81 bool - var yyhl81 bool = l >= 0 - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ContributorsEnabled = false - } else { - yyv82 := &x.ContributorsEnabled - yym83 := z.DecBinary() - _ = yym83 - if false { - } else { - *((*bool)(yyv82)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv84 := &x.CreatedAt - yym85 := z.DecBinary() - _ = yym85 - if false { - } else { - *((*string)(yyv84)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.DefaultProfile = false - } else { - yyv86 := &x.DefaultProfile - yym87 := z.DecBinary() - _ = yym87 - if false { - } else { - *((*bool)(yyv86)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.DefaultProfileImage = false - } else { - yyv88 := &x.DefaultProfileImage - yym89 := z.DecBinary() - _ = yym89 - if false { - } else { - *((*bool)(yyv88)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Description = "" - } else { - yyv90 := &x.Description - yym91 := z.DecBinary() - _ = yym91 - if false { - } else { - *((*string)(yyv90)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Entities = UserEntities{} - } else { - yyv92 := &x.Entities - yyv92.CodecDecodeSelf(d) - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FavouritesCount = 0 - } else { - yyv93 := &x.FavouritesCount - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - *((*int)(yyv93)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.FollowRequestSent != nil { - x.FollowRequestSent = nil - } - } else { - if x.FollowRequestSent == nil { - x.FollowRequestSent = new(string) - } - yym96 := z.DecBinary() - _ = yym96 - if false { - } else { - *((*string)(x.FollowRequestSent)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FollowersCount = 0 - } else { - yyv97 := &x.FollowersCount - yym98 := z.DecBinary() - _ = yym98 - if false { - } else { - *((*int)(yyv97)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Following != nil { - x.Following = nil - } - } else { - if x.Following == nil { - x.Following = new(string) - } - yym100 := z.DecBinary() - _ = yym100 - if false { - } else { - *((*string)(x.Following)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FriendsCount = 0 - } else { - yyv101 := &x.FriendsCount - yym102 := z.DecBinary() - _ = yym102 - if false { - } else { - *((*int)(yyv101)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.GeoEnabled = false - } else { - yyv103 := &x.GeoEnabled - yym104 := z.DecBinary() - _ = yym104 - if false { - } else { - *((*bool)(yyv103)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv105 := &x.ID - yym106 := z.DecBinary() - _ = yym106 - if false { - } else { - *((*int)(yyv105)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv107 := &x.IDStr - yym108 := z.DecBinary() - _ = yym108 - if false { - } else { - *((*string)(yyv107)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IsTranslator = false - } else { - yyv109 := &x.IsTranslator - yym110 := z.DecBinary() - _ = yym110 - if false { - } else { - *((*bool)(yyv109)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Lang = "" - } else { - yyv111 := &x.Lang - yym112 := z.DecBinary() - _ = yym112 - if false { - } else { - *((*string)(yyv111)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ListedCount = 0 - } else { - yyv113 := &x.ListedCount - yym114 := z.DecBinary() - _ = yym114 - if false { - } else { - *((*int)(yyv113)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Location = "" - } else { - yyv115 := &x.Location - yym116 := z.DecBinary() - _ = yym116 - if false { - } else { - *((*string)(yyv115)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv117 := &x.Name - yym118 := z.DecBinary() - _ = yym118 - if false { - } else { - *((*string)(yyv117)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Notifications != nil { - x.Notifications = nil - } - } else { - if x.Notifications == nil { - x.Notifications = new(string) - } - yym120 := z.DecBinary() - _ = yym120 - if false { - } else { - *((*string)(x.Notifications)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundColor = "" - } else { - yyv121 := &x.ProfileBackgroundColor - yym122 := z.DecBinary() - _ = yym122 - if false { - } else { - *((*string)(yyv121)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURL = "" - } else { - yyv123 := &x.ProfileBackgroundImageURL - yym124 := z.DecBinary() - _ = yym124 - if false { - } else { - *((*string)(yyv123)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURLHTTPS = "" - } else { - yyv125 := &x.ProfileBackgroundImageURLHTTPS - yym126 := z.DecBinary() - _ = yym126 - if false { - } else { - *((*string)(yyv125)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundTile = false - } else { - yyv127 := &x.ProfileBackgroundTile - yym128 := z.DecBinary() - _ = yym128 - if false { - } else { - *((*bool)(yyv127)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileImageURL = "" - } else { - yyv129 := &x.ProfileImageURL - yym130 := z.DecBinary() - _ = yym130 - if false { - } else { - *((*string)(yyv129)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileImageURLHTTPS = "" - } else { - yyv131 := &x.ProfileImageURLHTTPS - yym132 := z.DecBinary() - _ = yym132 - if false { - } else { - *((*string)(yyv131)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileLinkColor = "" - } else { - yyv133 := &x.ProfileLinkColor - yym134 := z.DecBinary() - _ = yym134 - if false { - } else { - *((*string)(yyv133)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileSidebarBorderColor = "" - } else { - yyv135 := &x.ProfileSidebarBorderColor - yym136 := z.DecBinary() - _ = yym136 - if false { - } else { - *((*string)(yyv135)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileSidebarFillColor = "" - } else { - yyv137 := &x.ProfileSidebarFillColor - yym138 := z.DecBinary() - _ = yym138 - if false { - } else { - *((*string)(yyv137)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileTextColor = "" - } else { - yyv139 := &x.ProfileTextColor - yym140 := z.DecBinary() - _ = yym140 - if false { - } else { - *((*string)(yyv139)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileUseBackgroundImage = false - } else { - yyv141 := &x.ProfileUseBackgroundImage - yym142 := z.DecBinary() - _ = yym142 - if false { - } else { - *((*bool)(yyv141)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Protected = false - } else { - yyv143 := &x.Protected - yym144 := z.DecBinary() - _ = yym144 - if false { - } else { - *((*bool)(yyv143)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ScreenName = "" - } else { - yyv145 := &x.ScreenName - yym146 := z.DecBinary() - _ = yym146 - if false { - } else { - *((*string)(yyv145)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ShowAllInlineMedia = false - } else { - yyv147 := &x.ShowAllInlineMedia - yym148 := z.DecBinary() - _ = yym148 - if false { - } else { - *((*bool)(yyv147)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.StatusesCount = 0 - } else { - yyv149 := &x.StatusesCount - yym150 := z.DecBinary() - _ = yym150 - if false { - } else { - *((*int)(yyv149)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv151 := &x.TimeZone - yym152 := z.DecBinary() - _ = yym152 - if false { - } else { - *((*string)(yyv151)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.URL != nil { - x.URL = nil - } - } else { - if x.URL == nil { - x.URL = new(string) - } - yym154 := z.DecBinary() - _ = yym154 - if false { - } else { - *((*string)(x.URL)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.UtcOffset = 0 - } else { - yyv155 := &x.UtcOffset - yym156 := z.DecBinary() - _ = yym156 - if false { - } else { - *((*int)(yyv155)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Verified = false - } else { - yyv157 := &x.Verified - yym158 := z.DecBinary() - _ = yym158 - if false { - } else { - *((*bool)(yyv157)) = r.DecodeBool() - } - } - for { - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj81-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *StatusMetadata) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IsoLanguageCode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("iso_language_code")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IsoLanguageCode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ResultType)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("result_type")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ResultType)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *StatusMetadata) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *StatusMetadata) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "iso_language_code": - if r.TryDecodeAsNil() { - x.IsoLanguageCode = "" - } else { - yyv4 := &x.IsoLanguageCode - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "result_type": - if r.TryDecodeAsNil() { - x.ResultType = "" - } else { - yyv6 := &x.ResultType - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *StatusMetadata) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IsoLanguageCode = "" - } else { - yyv9 := &x.IsoLanguageCode - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ResultType = "" - } else { - yyv11 := &x.ResultType - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Status) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [21]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(21) - } else { - yynn2 = 21 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Contributors == nil { - r.EncodeNil() - } else { - yy4 := *x.Contributors - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy4)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("contributors")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Contributors == nil { - r.EncodeNil() - } else { - yy6 := *x.Contributors - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy6)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Coordinates == nil { - r.EncodeNil() - } else { - yy9 := *x.Coordinates - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy9)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("coordinates")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Coordinates == nil { - r.EncodeNil() - } else { - yy11 := *x.Coordinates - yym12 := z.EncBinary() - _ = yym12 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy11)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("created_at")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym15 := z.EncBinary() - _ = yym15 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy17 := &x.Entities - yy17.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("entities")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy19 := &x.Entities - yy19.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeBool(bool(x.Favorited)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("favorited")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeBool(bool(x.Favorited)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Geo == nil { - r.EncodeNil() - } else { - yy25 := *x.Geo - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy25)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("geo")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Geo == nil { - r.EncodeNil() - } else { - yy27 := *x.Geo - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy27)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToScreenName == nil { - r.EncodeNil() - } else { - yy36 := *x.InReplyToScreenName - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy36)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_screen_name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToScreenName == nil { - r.EncodeNil() - } else { - yy38 := *x.InReplyToScreenName - yym39 := z.EncBinary() - _ = yym39 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy38)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToStatusID == nil { - r.EncodeNil() - } else { - yy41 := *x.InReplyToStatusID - yym42 := z.EncBinary() - _ = yym42 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy41)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_status_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToStatusID == nil { - r.EncodeNil() - } else { - yy43 := *x.InReplyToStatusID - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy43)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToStatusIDStr == nil { - r.EncodeNil() - } else { - yy46 := *x.InReplyToStatusIDStr - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy46)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_status_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToStatusIDStr == nil { - r.EncodeNil() - } else { - yy48 := *x.InReplyToStatusIDStr - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy48)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToUserID == nil { - r.EncodeNil() - } else { - yy51 := *x.InReplyToUserID - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy51)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_user_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToUserID == nil { - r.EncodeNil() - } else { - yy53 := *x.InReplyToUserID - yym54 := z.EncBinary() - _ = yym54 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy53)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToUserIDStr == nil { - r.EncodeNil() - } else { - yy56 := *x.InReplyToUserIDStr - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy56)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_user_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToUserIDStr == nil { - r.EncodeNil() - } else { - yy58 := *x.InReplyToUserIDStr - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy58)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy61 := &x.Metadata - yy61.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy63 := &x.Metadata - yy63.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Place == nil { - r.EncodeNil() - } else { - yy66 := *x.Place - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy66)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("place")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Place == nil { - r.EncodeNil() - } else { - yy68 := *x.Place - yym69 := z.EncBinary() - _ = yym69 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy68)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeInt(int64(x.RetweetCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("retweet_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeInt(int64(x.RetweetCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym74 := z.EncBinary() - _ = yym74 - if false { - } else { - r.EncodeBool(bool(x.Retweeted)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("retweeted")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeBool(bool(x.Retweeted)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym77 := z.EncBinary() - _ = yym77 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Source)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("source")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym78 := z.EncBinary() - _ = yym78 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Source)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym80 := z.EncBinary() - _ = yym80 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("text")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - r.EncodeBool(bool(x.Truncated)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("truncated")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeBool(bool(x.Truncated)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy86 := &x.User - yy86.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("user")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy88 := &x.User - yy88.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Status) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Status) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "contributors": - if r.TryDecodeAsNil() { - if x.Contributors != nil { - x.Contributors = nil - } - } else { - if x.Contributors == nil { - x.Contributors = new(string) - } - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(x.Contributors)) = r.DecodeString() - } - } - case "coordinates": - if r.TryDecodeAsNil() { - if x.Coordinates != nil { - x.Coordinates = nil - } - } else { - if x.Coordinates == nil { - x.Coordinates = new(string) - } - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(x.Coordinates)) = r.DecodeString() - } - } - case "created_at": - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv8 := &x.CreatedAt - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "entities": - if r.TryDecodeAsNil() { - x.Entities = Entities{} - } else { - yyv10 := &x.Entities - yyv10.CodecDecodeSelf(d) - } - case "favorited": - if r.TryDecodeAsNil() { - x.Favorited = false - } else { - yyv11 := &x.Favorited - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - case "geo": - if r.TryDecodeAsNil() { - if x.Geo != nil { - x.Geo = nil - } - } else { - if x.Geo == nil { - x.Geo = new(string) - } - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(x.Geo)) = r.DecodeString() - } - } - case "id": - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv15 := &x.ID - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - case "id_str": - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv17 := &x.IDStr - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - case "in_reply_to_screen_name": - if r.TryDecodeAsNil() { - if x.InReplyToScreenName != nil { - x.InReplyToScreenName = nil - } - } else { - if x.InReplyToScreenName == nil { - x.InReplyToScreenName = new(string) - } - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(x.InReplyToScreenName)) = r.DecodeString() - } - } - case "in_reply_to_status_id": - if r.TryDecodeAsNil() { - if x.InReplyToStatusID != nil { - x.InReplyToStatusID = nil - } - } else { - if x.InReplyToStatusID == nil { - x.InReplyToStatusID = new(string) - } - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(x.InReplyToStatusID)) = r.DecodeString() - } - } - case "in_reply_to_status_id_str": - if r.TryDecodeAsNil() { - if x.InReplyToStatusIDStr != nil { - x.InReplyToStatusIDStr = nil - } - } else { - if x.InReplyToStatusIDStr == nil { - x.InReplyToStatusIDStr = new(string) - } - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(x.InReplyToStatusIDStr)) = r.DecodeString() - } - } - case "in_reply_to_user_id": - if r.TryDecodeAsNil() { - if x.InReplyToUserID != nil { - x.InReplyToUserID = nil - } - } else { - if x.InReplyToUserID == nil { - x.InReplyToUserID = new(string) - } - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(x.InReplyToUserID)) = r.DecodeString() - } - } - case "in_reply_to_user_id_str": - if r.TryDecodeAsNil() { - if x.InReplyToUserIDStr != nil { - x.InReplyToUserIDStr = nil - } - } else { - if x.InReplyToUserIDStr == nil { - x.InReplyToUserIDStr = new(string) - } - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(x.InReplyToUserIDStr)) = r.DecodeString() - } - } - case "metadata": - if r.TryDecodeAsNil() { - x.Metadata = StatusMetadata{} - } else { - yyv29 := &x.Metadata - yyv29.CodecDecodeSelf(d) - } - case "place": - if r.TryDecodeAsNil() { - if x.Place != nil { - x.Place = nil - } - } else { - if x.Place == nil { - x.Place = new(string) - } - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(x.Place)) = r.DecodeString() - } - } - case "retweet_count": - if r.TryDecodeAsNil() { - x.RetweetCount = 0 - } else { - yyv32 := &x.RetweetCount - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*int)(yyv32)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "retweeted": - if r.TryDecodeAsNil() { - x.Retweeted = false - } else { - yyv34 := &x.Retweeted - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*bool)(yyv34)) = r.DecodeBool() - } - } - case "source": - if r.TryDecodeAsNil() { - x.Source = "" - } else { - yyv36 := &x.Source - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*string)(yyv36)) = r.DecodeString() - } - } - case "text": - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv38 := &x.Text - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*string)(yyv38)) = r.DecodeString() - } - } - case "truncated": - if r.TryDecodeAsNil() { - x.Truncated = false - } else { - yyv40 := &x.Truncated - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*bool)(yyv40)) = r.DecodeBool() - } - } - case "user": - if r.TryDecodeAsNil() { - x.User = User{} - } else { - yyv42 := &x.User - yyv42.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Status) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj43 int - var yyb43 bool - var yyhl43 bool = l >= 0 - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Contributors != nil { - x.Contributors = nil - } - } else { - if x.Contributors == nil { - x.Contributors = new(string) - } - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*string)(x.Contributors)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Coordinates != nil { - x.Coordinates = nil - } - } else { - if x.Coordinates == nil { - x.Coordinates = new(string) - } - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*string)(x.Coordinates)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv48 := &x.CreatedAt - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*string)(yyv48)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Entities = Entities{} - } else { - yyv50 := &x.Entities - yyv50.CodecDecodeSelf(d) - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Favorited = false - } else { - yyv51 := &x.Favorited - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*bool)(yyv51)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Geo != nil { - x.Geo = nil - } - } else { - if x.Geo == nil { - x.Geo = new(string) - } - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*string)(x.Geo)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv55 := &x.ID - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*int64)(yyv55)) = int64(r.DecodeInt(64)) - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv57 := &x.IDStr - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToScreenName != nil { - x.InReplyToScreenName = nil - } - } else { - if x.InReplyToScreenName == nil { - x.InReplyToScreenName = new(string) - } - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(x.InReplyToScreenName)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToStatusID != nil { - x.InReplyToStatusID = nil - } - } else { - if x.InReplyToStatusID == nil { - x.InReplyToStatusID = new(string) - } - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*string)(x.InReplyToStatusID)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToStatusIDStr != nil { - x.InReplyToStatusIDStr = nil - } - } else { - if x.InReplyToStatusIDStr == nil { - x.InReplyToStatusIDStr = new(string) - } - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*string)(x.InReplyToStatusIDStr)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToUserID != nil { - x.InReplyToUserID = nil - } - } else { - if x.InReplyToUserID == nil { - x.InReplyToUserID = new(string) - } - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*string)(x.InReplyToUserID)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToUserIDStr != nil { - x.InReplyToUserIDStr = nil - } - } else { - if x.InReplyToUserIDStr == nil { - x.InReplyToUserIDStr = new(string) - } - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(x.InReplyToUserIDStr)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Metadata = StatusMetadata{} - } else { - yyv69 := &x.Metadata - yyv69.CodecDecodeSelf(d) - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Place != nil { - x.Place = nil - } - } else { - if x.Place == nil { - x.Place = new(string) - } - yym71 := z.DecBinary() - _ = yym71 - if false { - } else { - *((*string)(x.Place)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.RetweetCount = 0 - } else { - yyv72 := &x.RetweetCount - yym73 := z.DecBinary() - _ = yym73 - if false { - } else { - *((*int)(yyv72)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Retweeted = false - } else { - yyv74 := &x.Retweeted - yym75 := z.DecBinary() - _ = yym75 - if false { - } else { - *((*bool)(yyv74)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Source = "" - } else { - yyv76 := &x.Source - yym77 := z.DecBinary() - _ = yym77 - if false { - } else { - *((*string)(yyv76)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv78 := &x.Text - yym79 := z.DecBinary() - _ = yym79 - if false { - } else { - *((*string)(yyv78)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Truncated = false - } else { - yyv80 := &x.Truncated - yym81 := z.DecBinary() - _ = yym81 - if false { - } else { - *((*bool)(yyv80)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.User = User{} - } else { - yyv82 := &x.User - yyv82.CodecDecodeSelf(d) - } - for { - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj43-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *LargeStruct) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy4 := &x.SearchMetadata - yy4.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("search_metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy6 := &x.SearchMetadata - yy6.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Statuses == nil { - r.EncodeNil() - } else { - yym9 := z.EncBinary() - _ = yym9 - if false { - } else { - h.encSliceStatus(([]Status)(x.Statuses), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("statuses")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Statuses == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - h.encSliceStatus(([]Status)(x.Statuses), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *LargeStruct) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *LargeStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "search_metadata": - if r.TryDecodeAsNil() { - x.SearchMetadata = SearchMetadata{} - } else { - yyv4 := &x.SearchMetadata - yyv4.CodecDecodeSelf(d) - } - case "statuses": - if r.TryDecodeAsNil() { - x.Statuses = nil - } else { - yyv5 := &x.Statuses - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - h.decSliceStatus((*[]Status)(yyv5), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *LargeStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SearchMetadata = SearchMetadata{} - } else { - yyv8 := &x.SearchMetadata - yyv8.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Statuses = nil - } else { - yyv9 := &x.Statuses - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - h.decSliceStatus((*[]Status)(yyv9), d) - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *XLStruct) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Data == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceLargeStruct(([]LargeStruct)(x.Data), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("Data")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Data == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceLargeStruct(([]LargeStruct)(x.Data), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *XLStruct) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *XLStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "Data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv4 := &x.Data - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceLargeStruct((*[]LargeStruct)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *XLStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv7 := &x.Data - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSliceLargeStruct((*[]LargeStruct)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) encSliceHashtag(v []Hashtag, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceHashtag(v *[]Hashtag, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []Hashtag{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]Hashtag, yyrl1) - } - } else { - yyv1 = make([]Hashtag, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, Hashtag{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, Hashtag{}) // var yyz1 Hashtag - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []Hashtag{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSlicePtrtostring(v []*string, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if yyv1 == nil { - r.EncodeNil() - } else { - yy2 := *yyv1 - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy2)) - } - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSlicePtrtostring(v *[]*string, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*string{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*string, yyrl1) - } - } else { - yyv1 = make([]*string, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw2 := yyv1[yyj1] - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyw2)) = r.DecodeString() - } - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw4 := yyv1[yyj1] - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyw4)) = r.DecodeString() - } - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *string - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw6 := yyv1[yyj1] - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyw6)) = r.DecodeString() - } - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*string{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceURL(v []URL, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceURL(v *[]URL, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []URL{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 48) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]URL, yyrl1) - } - } else { - yyv1 = make([]URL, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, URL{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, URL{}) // var yyz1 URL - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []URL{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceStatus(v []Status, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceStatus(v *[]Status, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []Status{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 752) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]Status, yyrl1) - } - } else { - yyv1 = make([]Status, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, Status{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, Status{}) // var yyz1 Status - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []Status{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceLargeStruct(v []LargeStruct, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceLargeStruct(v *[]LargeStruct, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []LargeStruct{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 136) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]LargeStruct, yyrl1) - } - } else { - yyv1 = make([]LargeStruct, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, LargeStruct{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, LargeStruct{}) // var yyz1 LargeStruct - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []LargeStruct{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} diff --git a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go b/cmd/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go deleted file mode 100644 index 9f000d3ad2..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go +++ /dev/null @@ -1,6723 +0,0 @@ -// +build use_ffjson - -// DO NOT EDIT! -// Code generated by ffjson -// source: .root/src/github.com/mailru/easyjson/benchmark/data.go -// DO NOT EDIT! - -package benchmark - -import ( - "bytes" - "errors" - "fmt" - fflib "github.com/pquerna/ffjson/fflib/v1" -) - -func (mj *Entities) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Entities) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"hashtags":`) - if mj.Hashtags != nil { - buf.WriteString(`[`) - for i, v := range mj.Hashtags { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"user_mentions":`) - if mj.UserMentions != nil { - buf.WriteString(`[`) - for i, v := range mj.UserMentions { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Entitiesbase = iota - ffj_t_Entitiesno_such_key - - ffj_t_Entities_Hashtags - - ffj_t_Entities_Urls - - ffj_t_Entities_UserMentions -) - -var ffj_key_Entities_Hashtags = []byte("hashtags") - -var ffj_key_Entities_Urls = []byte("urls") - -var ffj_key_Entities_UserMentions = []byte("user_mentions") - -func (uj *Entities) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Entities) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Entitiesbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Entitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'h': - - if bytes.Equal(ffj_key_Entities_Hashtags, kn) { - currentKey = ffj_t_Entities_Hashtags - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_Entities_Urls, kn) { - currentKey = ffj_t_Entities_Urls - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Entities_UserMentions, kn) { - currentKey = ffj_t_Entities_UserMentions - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_Entities_UserMentions, kn) { - currentKey = ffj_t_Entities_UserMentions - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Entities_Urls, kn) { - currentKey = ffj_t_Entities_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Entities_Hashtags, kn) { - currentKey = ffj_t_Entities_Hashtags - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Entitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Entities_Hashtags: - goto handle_Hashtags - - case ffj_t_Entities_Urls: - goto handle_Urls - - case ffj_t_Entities_UserMentions: - goto handle_UserMentions - - case ffj_t_Entitiesno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Hashtags: - - /* handler: uj.Hashtags type=[]benchmark.Hashtag kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Hashtags = nil - } else { - - uj.Hashtags = make([]Hashtag, 0) - - wantVal := true - - for { - - var tmp_uj__Hashtags Hashtag - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Hashtags type=benchmark.Hashtag kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Hashtags.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Hashtags = append(uj.Hashtags, tmp_uj__Hashtags) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Urls: - - /* handler: uj.Urls type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__Urls *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__Urls = nil - } else { - if tmp_uj__Urls == nil { - tmp_uj__Urls = new(string) - } - - /* handler: tmp_uj__Urls type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__Urls = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__Urls = &tval - - } - } - - } - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_UserMentions: - - /* handler: uj.UserMentions type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.UserMentions = nil - } else { - - uj.UserMentions = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__UserMentions *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__UserMentions type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__UserMentions = nil - } else { - if tmp_uj__UserMentions == nil { - tmp_uj__UserMentions = new(string) - } - - /* handler: tmp_uj__UserMentions type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__UserMentions = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__UserMentions = &tval - - } - } - - } - } - - uj.UserMentions = append(uj.UserMentions, tmp_uj__UserMentions) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *Hashtag) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Hashtag) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"indices":`) - if mj.Indices != nil { - buf.WriteString(`[`) - for i, v := range mj.Indices { - if i != 0 { - buf.WriteString(`,`) - } - fflib.FormatBits2(buf, uint64(v), 10, v < 0) - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"text":`) - fflib.WriteJsonString(buf, string(mj.Text)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Hashtagbase = iota - ffj_t_Hashtagno_such_key - - ffj_t_Hashtag_Indices - - ffj_t_Hashtag_Text -) - -var ffj_key_Hashtag_Indices = []byte("indices") - -var ffj_key_Hashtag_Text = []byte("text") - -func (uj *Hashtag) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Hashtag) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Hashtagbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Hashtagno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'i': - - if bytes.Equal(ffj_key_Hashtag_Indices, kn) { - currentKey = ffj_t_Hashtag_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_Hashtag_Text, kn) { - currentKey = ffj_t_Hashtag_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_Hashtag_Text, kn) { - currentKey = ffj_t_Hashtag_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Hashtag_Indices, kn) { - currentKey = ffj_t_Hashtag_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Hashtagno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Hashtag_Indices: - goto handle_Indices - - case ffj_t_Hashtag_Text: - goto handle_Text - - case ffj_t_Hashtagno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Indices: - - /* handler: uj.Indices type=[]int kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Indices = nil - } else { - - uj.Indices = make([]int, 0) - - wantVal := true - - for { - - var tmp_uj__Indices int - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Indices type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - tmp_uj__Indices = int(tval) - - } - } - - uj.Indices = append(uj.Indices, tmp_uj__Indices) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Text: - - /* handler: uj.Text type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Text = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *LargeStruct) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *LargeStruct) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"search_metadata":`) - - { - - err = mj.SearchMetadata.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"statuses":`) - if mj.Statuses != nil { - buf.WriteString(`[`) - for i, v := range mj.Statuses { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_LargeStructbase = iota - ffj_t_LargeStructno_such_key - - ffj_t_LargeStruct_SearchMetadata - - ffj_t_LargeStruct_Statuses -) - -var ffj_key_LargeStruct_SearchMetadata = []byte("search_metadata") - -var ffj_key_LargeStruct_Statuses = []byte("statuses") - -func (uj *LargeStruct) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *LargeStruct) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_LargeStructbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_LargeStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 's': - - if bytes.Equal(ffj_key_LargeStruct_SearchMetadata, kn) { - currentKey = ffj_t_LargeStruct_SearchMetadata - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_LargeStruct_Statuses, kn) { - currentKey = ffj_t_LargeStruct_Statuses - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_LargeStruct_Statuses, kn) { - currentKey = ffj_t_LargeStruct_Statuses - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_LargeStruct_SearchMetadata, kn) { - currentKey = ffj_t_LargeStruct_SearchMetadata - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_LargeStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_LargeStruct_SearchMetadata: - goto handle_SearchMetadata - - case ffj_t_LargeStruct_Statuses: - goto handle_Statuses - - case ffj_t_LargeStructno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_SearchMetadata: - - /* handler: uj.SearchMetadata type=benchmark.SearchMetadata kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.SearchMetadata.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Statuses: - - /* handler: uj.Statuses type=[]benchmark.Status kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Statuses = nil - } else { - - uj.Statuses = make([]Status, 0) - - wantVal := true - - for { - - var tmp_uj__Statuses Status - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Statuses type=benchmark.Status kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Statuses.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Statuses = append(uj.Statuses, tmp_uj__Statuses) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *SearchMetadata) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *SearchMetadata) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"completed_in":`) - fflib.AppendFloat(buf, float64(mj.CompletedIn), 'g', -1, 64) - buf.WriteString(`,"count":`) - fflib.FormatBits2(buf, uint64(mj.Count), 10, mj.Count < 0) - buf.WriteString(`,"max_id":`) - fflib.FormatBits2(buf, uint64(mj.MaxID), 10, mj.MaxID < 0) - buf.WriteString(`,"max_id_str":`) - fflib.WriteJsonString(buf, string(mj.MaxIDStr)) - buf.WriteString(`,"next_results":`) - fflib.WriteJsonString(buf, string(mj.NextResults)) - buf.WriteString(`,"query":`) - fflib.WriteJsonString(buf, string(mj.Query)) - buf.WriteString(`,"refresh_url":`) - fflib.WriteJsonString(buf, string(mj.RefreshURL)) - buf.WriteString(`,"since_id":`) - fflib.FormatBits2(buf, uint64(mj.SinceID), 10, mj.SinceID < 0) - buf.WriteString(`,"since_id_str":`) - fflib.WriteJsonString(buf, string(mj.SinceIDStr)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_SearchMetadatabase = iota - ffj_t_SearchMetadatano_such_key - - ffj_t_SearchMetadata_CompletedIn - - ffj_t_SearchMetadata_Count - - ffj_t_SearchMetadata_MaxID - - ffj_t_SearchMetadata_MaxIDStr - - ffj_t_SearchMetadata_NextResults - - ffj_t_SearchMetadata_Query - - ffj_t_SearchMetadata_RefreshURL - - ffj_t_SearchMetadata_SinceID - - ffj_t_SearchMetadata_SinceIDStr -) - -var ffj_key_SearchMetadata_CompletedIn = []byte("completed_in") - -var ffj_key_SearchMetadata_Count = []byte("count") - -var ffj_key_SearchMetadata_MaxID = []byte("max_id") - -var ffj_key_SearchMetadata_MaxIDStr = []byte("max_id_str") - -var ffj_key_SearchMetadata_NextResults = []byte("next_results") - -var ffj_key_SearchMetadata_Query = []byte("query") - -var ffj_key_SearchMetadata_RefreshURL = []byte("refresh_url") - -var ffj_key_SearchMetadata_SinceID = []byte("since_id") - -var ffj_key_SearchMetadata_SinceIDStr = []byte("since_id_str") - -func (uj *SearchMetadata) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *SearchMetadata) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_SearchMetadatabase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_SearchMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_SearchMetadata_CompletedIn, kn) { - currentKey = ffj_t_SearchMetadata_CompletedIn - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_Count, kn) { - currentKey = ffj_t_SearchMetadata_Count - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'm': - - if bytes.Equal(ffj_key_SearchMetadata_MaxID, kn) { - currentKey = ffj_t_SearchMetadata_MaxID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_MaxIDStr, kn) { - currentKey = ffj_t_SearchMetadata_MaxIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'n': - - if bytes.Equal(ffj_key_SearchMetadata_NextResults, kn) { - currentKey = ffj_t_SearchMetadata_NextResults - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'q': - - if bytes.Equal(ffj_key_SearchMetadata_Query, kn) { - currentKey = ffj_t_SearchMetadata_Query - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_SearchMetadata_RefreshURL, kn) { - currentKey = ffj_t_SearchMetadata_RefreshURL - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_SearchMetadata_SinceID, kn) { - currentKey = ffj_t_SearchMetadata_SinceID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_SinceIDStr, kn) { - currentKey = ffj_t_SearchMetadata_SinceIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_SinceIDStr, kn) { - currentKey = ffj_t_SearchMetadata_SinceIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_SinceID, kn) { - currentKey = ffj_t_SearchMetadata_SinceID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_RefreshURL, kn) { - currentKey = ffj_t_SearchMetadata_RefreshURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_SearchMetadata_Query, kn) { - currentKey = ffj_t_SearchMetadata_Query - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_NextResults, kn) { - currentKey = ffj_t_SearchMetadata_NextResults - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_MaxIDStr, kn) { - currentKey = ffj_t_SearchMetadata_MaxIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_SearchMetadata_MaxID, kn) { - currentKey = ffj_t_SearchMetadata_MaxID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_SearchMetadata_Count, kn) { - currentKey = ffj_t_SearchMetadata_Count - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_SearchMetadata_CompletedIn, kn) { - currentKey = ffj_t_SearchMetadata_CompletedIn - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_SearchMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_SearchMetadata_CompletedIn: - goto handle_CompletedIn - - case ffj_t_SearchMetadata_Count: - goto handle_Count - - case ffj_t_SearchMetadata_MaxID: - goto handle_MaxID - - case ffj_t_SearchMetadata_MaxIDStr: - goto handle_MaxIDStr - - case ffj_t_SearchMetadata_NextResults: - goto handle_NextResults - - case ffj_t_SearchMetadata_Query: - goto handle_Query - - case ffj_t_SearchMetadata_RefreshURL: - goto handle_RefreshURL - - case ffj_t_SearchMetadata_SinceID: - goto handle_SinceID - - case ffj_t_SearchMetadata_SinceIDStr: - goto handle_SinceIDStr - - case ffj_t_SearchMetadatano_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_CompletedIn: - - /* handler: uj.CompletedIn type=float64 kind=float64 quoted=false*/ - - { - if tok != fflib.FFTok_double && tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for float64", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseFloat(fs.Output.Bytes(), 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.CompletedIn = float64(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Count: - - /* handler: uj.Count type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.Count = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_MaxID: - - /* handler: uj.MaxID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.MaxID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_MaxIDStr: - - /* handler: uj.MaxIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.MaxIDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_NextResults: - - /* handler: uj.NextResults type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.NextResults = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Query: - - /* handler: uj.Query type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Query = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_RefreshURL: - - /* handler: uj.RefreshURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.RefreshURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_SinceID: - - /* handler: uj.SinceID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.SinceID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_SinceIDStr: - - /* handler: uj.SinceIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.SinceIDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *Status) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Status) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.Contributors != nil { - buf.WriteString(`{"contributors":`) - fflib.WriteJsonString(buf, string(*mj.Contributors)) - } else { - buf.WriteString(`{"contributors":null`) - } - if mj.Coordinates != nil { - buf.WriteString(`,"coordinates":`) - fflib.WriteJsonString(buf, string(*mj.Coordinates)) - } else { - buf.WriteString(`,"coordinates":null`) - } - buf.WriteString(`,"created_at":`) - fflib.WriteJsonString(buf, string(mj.CreatedAt)) - buf.WriteString(`,"entities":`) - - { - - err = mj.Entities.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - if mj.Favorited { - buf.WriteString(`,"favorited":true`) - } else { - buf.WriteString(`,"favorited":false`) - } - if mj.Geo != nil { - buf.WriteString(`,"geo":`) - fflib.WriteJsonString(buf, string(*mj.Geo)) - } else { - buf.WriteString(`,"geo":null`) - } - buf.WriteString(`,"id":`) - fflib.FormatBits2(buf, uint64(mj.ID), 10, mj.ID < 0) - buf.WriteString(`,"id_str":`) - fflib.WriteJsonString(buf, string(mj.IDStr)) - if mj.InReplyToScreenName != nil { - buf.WriteString(`,"in_reply_to_screen_name":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToScreenName)) - } else { - buf.WriteString(`,"in_reply_to_screen_name":null`) - } - if mj.InReplyToStatusID != nil { - buf.WriteString(`,"in_reply_to_status_id":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToStatusID)) - } else { - buf.WriteString(`,"in_reply_to_status_id":null`) - } - if mj.InReplyToStatusIDStr != nil { - buf.WriteString(`,"in_reply_to_status_id_str":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToStatusIDStr)) - } else { - buf.WriteString(`,"in_reply_to_status_id_str":null`) - } - if mj.InReplyToUserID != nil { - buf.WriteString(`,"in_reply_to_user_id":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToUserID)) - } else { - buf.WriteString(`,"in_reply_to_user_id":null`) - } - if mj.InReplyToUserIDStr != nil { - buf.WriteString(`,"in_reply_to_user_id_str":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToUserIDStr)) - } else { - buf.WriteString(`,"in_reply_to_user_id_str":null`) - } - buf.WriteString(`,"metadata":`) - - { - - err = mj.Metadata.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - if mj.Place != nil { - buf.WriteString(`,"place":`) - fflib.WriteJsonString(buf, string(*mj.Place)) - } else { - buf.WriteString(`,"place":null`) - } - buf.WriteString(`,"retweet_count":`) - fflib.FormatBits2(buf, uint64(mj.RetweetCount), 10, mj.RetweetCount < 0) - if mj.Retweeted { - buf.WriteString(`,"retweeted":true`) - } else { - buf.WriteString(`,"retweeted":false`) - } - buf.WriteString(`,"source":`) - fflib.WriteJsonString(buf, string(mj.Source)) - buf.WriteString(`,"text":`) - fflib.WriteJsonString(buf, string(mj.Text)) - if mj.Truncated { - buf.WriteString(`,"truncated":true`) - } else { - buf.WriteString(`,"truncated":false`) - } - buf.WriteString(`,"user":`) - - { - - err = mj.User.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Statusbase = iota - ffj_t_Statusno_such_key - - ffj_t_Status_Contributors - - ffj_t_Status_Coordinates - - ffj_t_Status_CreatedAt - - ffj_t_Status_Entities - - ffj_t_Status_Favorited - - ffj_t_Status_Geo - - ffj_t_Status_ID - - ffj_t_Status_IDStr - - ffj_t_Status_InReplyToScreenName - - ffj_t_Status_InReplyToStatusID - - ffj_t_Status_InReplyToStatusIDStr - - ffj_t_Status_InReplyToUserID - - ffj_t_Status_InReplyToUserIDStr - - ffj_t_Status_Metadata - - ffj_t_Status_Place - - ffj_t_Status_RetweetCount - - ffj_t_Status_Retweeted - - ffj_t_Status_Source - - ffj_t_Status_Text - - ffj_t_Status_Truncated - - ffj_t_Status_User -) - -var ffj_key_Status_Contributors = []byte("contributors") - -var ffj_key_Status_Coordinates = []byte("coordinates") - -var ffj_key_Status_CreatedAt = []byte("created_at") - -var ffj_key_Status_Entities = []byte("entities") - -var ffj_key_Status_Favorited = []byte("favorited") - -var ffj_key_Status_Geo = []byte("geo") - -var ffj_key_Status_ID = []byte("id") - -var ffj_key_Status_IDStr = []byte("id_str") - -var ffj_key_Status_InReplyToScreenName = []byte("in_reply_to_screen_name") - -var ffj_key_Status_InReplyToStatusID = []byte("in_reply_to_status_id") - -var ffj_key_Status_InReplyToStatusIDStr = []byte("in_reply_to_status_id_str") - -var ffj_key_Status_InReplyToUserID = []byte("in_reply_to_user_id") - -var ffj_key_Status_InReplyToUserIDStr = []byte("in_reply_to_user_id_str") - -var ffj_key_Status_Metadata = []byte("metadata") - -var ffj_key_Status_Place = []byte("place") - -var ffj_key_Status_RetweetCount = []byte("retweet_count") - -var ffj_key_Status_Retweeted = []byte("retweeted") - -var ffj_key_Status_Source = []byte("source") - -var ffj_key_Status_Text = []byte("text") - -var ffj_key_Status_Truncated = []byte("truncated") - -var ffj_key_Status_User = []byte("user") - -func (uj *Status) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Status) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Statusbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Statusno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_Status_Contributors, kn) { - currentKey = ffj_t_Status_Contributors - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Coordinates, kn) { - currentKey = ffj_t_Status_Coordinates - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_CreatedAt, kn) { - currentKey = ffj_t_Status_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'e': - - if bytes.Equal(ffj_key_Status_Entities, kn) { - currentKey = ffj_t_Status_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'f': - - if bytes.Equal(ffj_key_Status_Favorited, kn) { - currentKey = ffj_t_Status_Favorited - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'g': - - if bytes.Equal(ffj_key_Status_Geo, kn) { - currentKey = ffj_t_Status_Geo - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_Status_ID, kn) { - currentKey = ffj_t_Status_ID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_IDStr, kn) { - currentKey = ffj_t_Status_IDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToScreenName, kn) { - currentKey = ffj_t_Status_InReplyToScreenName - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToStatusID, kn) { - currentKey = ffj_t_Status_InReplyToStatusID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToStatusIDStr, kn) { - currentKey = ffj_t_Status_InReplyToStatusIDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToUserID, kn) { - currentKey = ffj_t_Status_InReplyToUserID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToUserIDStr, kn) { - currentKey = ffj_t_Status_InReplyToUserIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'm': - - if bytes.Equal(ffj_key_Status_Metadata, kn) { - currentKey = ffj_t_Status_Metadata - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'p': - - if bytes.Equal(ffj_key_Status_Place, kn) { - currentKey = ffj_t_Status_Place - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_Status_RetweetCount, kn) { - currentKey = ffj_t_Status_RetweetCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Retweeted, kn) { - currentKey = ffj_t_Status_Retweeted - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_Status_Source, kn) { - currentKey = ffj_t_Status_Source - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_Status_Text, kn) { - currentKey = ffj_t_Status_Text - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Truncated, kn) { - currentKey = ffj_t_Status_Truncated - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_Status_User, kn) { - currentKey = ffj_t_Status_User - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_Status_User, kn) { - currentKey = ffj_t_Status_User - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Truncated, kn) { - currentKey = ffj_t_Status_Truncated - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Text, kn) { - currentKey = ffj_t_Status_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Source, kn) { - currentKey = ffj_t_Status_Source - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Retweeted, kn) { - currentKey = ffj_t_Status_Retweeted - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_Status_RetweetCount, kn) { - currentKey = ffj_t_Status_RetweetCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Place, kn) { - currentKey = ffj_t_Status_Place - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Metadata, kn) { - currentKey = ffj_t_Status_Metadata - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToUserIDStr, kn) { - currentKey = ffj_t_Status_InReplyToUserIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToUserID, kn) { - currentKey = ffj_t_Status_InReplyToUserID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToStatusIDStr, kn) { - currentKey = ffj_t_Status_InReplyToStatusIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToStatusID, kn) { - currentKey = ffj_t_Status_InReplyToStatusID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToScreenName, kn) { - currentKey = ffj_t_Status_InReplyToScreenName - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_IDStr, kn) { - currentKey = ffj_t_Status_IDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_ID, kn) { - currentKey = ffj_t_Status_ID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Geo, kn) { - currentKey = ffj_t_Status_Geo - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Favorited, kn) { - currentKey = ffj_t_Status_Favorited - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Entities, kn) { - currentKey = ffj_t_Status_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_Status_CreatedAt, kn) { - currentKey = ffj_t_Status_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Coordinates, kn) { - currentKey = ffj_t_Status_Coordinates - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Contributors, kn) { - currentKey = ffj_t_Status_Contributors - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Statusno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Status_Contributors: - goto handle_Contributors - - case ffj_t_Status_Coordinates: - goto handle_Coordinates - - case ffj_t_Status_CreatedAt: - goto handle_CreatedAt - - case ffj_t_Status_Entities: - goto handle_Entities - - case ffj_t_Status_Favorited: - goto handle_Favorited - - case ffj_t_Status_Geo: - goto handle_Geo - - case ffj_t_Status_ID: - goto handle_ID - - case ffj_t_Status_IDStr: - goto handle_IDStr - - case ffj_t_Status_InReplyToScreenName: - goto handle_InReplyToScreenName - - case ffj_t_Status_InReplyToStatusID: - goto handle_InReplyToStatusID - - case ffj_t_Status_InReplyToStatusIDStr: - goto handle_InReplyToStatusIDStr - - case ffj_t_Status_InReplyToUserID: - goto handle_InReplyToUserID - - case ffj_t_Status_InReplyToUserIDStr: - goto handle_InReplyToUserIDStr - - case ffj_t_Status_Metadata: - goto handle_Metadata - - case ffj_t_Status_Place: - goto handle_Place - - case ffj_t_Status_RetweetCount: - goto handle_RetweetCount - - case ffj_t_Status_Retweeted: - goto handle_Retweeted - - case ffj_t_Status_Source: - goto handle_Source - - case ffj_t_Status_Text: - goto handle_Text - - case ffj_t_Status_Truncated: - goto handle_Truncated - - case ffj_t_Status_User: - goto handle_User - - case ffj_t_Statusno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Contributors: - - /* handler: uj.Contributors type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Contributors = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Contributors = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Coordinates: - - /* handler: uj.Coordinates type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Coordinates = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Coordinates = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_CreatedAt: - - /* handler: uj.CreatedAt type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.CreatedAt = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Entities: - - /* handler: uj.Entities type=benchmark.Entities kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Entities.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Favorited: - - /* handler: uj.Favorited type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Favorited = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Favorited = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Geo: - - /* handler: uj.Geo type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Geo = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Geo = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ID: - - /* handler: uj.ID type=int64 kind=int64 quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int64", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ID = int64(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IDStr: - - /* handler: uj.IDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToScreenName: - - /* handler: uj.InReplyToScreenName type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToScreenName = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToScreenName = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToStatusID: - - /* handler: uj.InReplyToStatusID type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToStatusID = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToStatusID = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToStatusIDStr: - - /* handler: uj.InReplyToStatusIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToStatusIDStr = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToStatusIDStr = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToUserID: - - /* handler: uj.InReplyToUserID type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToUserID = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToUserID = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToUserIDStr: - - /* handler: uj.InReplyToUserIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToUserIDStr = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToUserIDStr = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Metadata: - - /* handler: uj.Metadata type=benchmark.StatusMetadata kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Metadata.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Place: - - /* handler: uj.Place type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Place = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Place = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_RetweetCount: - - /* handler: uj.RetweetCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.RetweetCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Retweeted: - - /* handler: uj.Retweeted type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Retweeted = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Retweeted = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Source: - - /* handler: uj.Source type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Source = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Text: - - /* handler: uj.Text type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Text = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Truncated: - - /* handler: uj.Truncated type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Truncated = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Truncated = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_User: - - /* handler: uj.User type=benchmark.User kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.User.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *StatusMetadata) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *StatusMetadata) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"iso_language_code":`) - fflib.WriteJsonString(buf, string(mj.IsoLanguageCode)) - buf.WriteString(`,"result_type":`) - fflib.WriteJsonString(buf, string(mj.ResultType)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_StatusMetadatabase = iota - ffj_t_StatusMetadatano_such_key - - ffj_t_StatusMetadata_IsoLanguageCode - - ffj_t_StatusMetadata_ResultType -) - -var ffj_key_StatusMetadata_IsoLanguageCode = []byte("iso_language_code") - -var ffj_key_StatusMetadata_ResultType = []byte("result_type") - -func (uj *StatusMetadata) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *StatusMetadata) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_StatusMetadatabase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_StatusMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'i': - - if bytes.Equal(ffj_key_StatusMetadata_IsoLanguageCode, kn) { - currentKey = ffj_t_StatusMetadata_IsoLanguageCode - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_StatusMetadata_ResultType, kn) { - currentKey = ffj_t_StatusMetadata_ResultType - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_StatusMetadata_ResultType, kn) { - currentKey = ffj_t_StatusMetadata_ResultType - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_StatusMetadata_IsoLanguageCode, kn) { - currentKey = ffj_t_StatusMetadata_IsoLanguageCode - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_StatusMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_StatusMetadata_IsoLanguageCode: - goto handle_IsoLanguageCode - - case ffj_t_StatusMetadata_ResultType: - goto handle_ResultType - - case ffj_t_StatusMetadatano_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_IsoLanguageCode: - - /* handler: uj.IsoLanguageCode type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IsoLanguageCode = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ResultType: - - /* handler: uj.ResultType type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ResultType = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *URL) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *URL) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.ExpandedURL != nil { - buf.WriteString(`{"expanded_url":`) - fflib.WriteJsonString(buf, string(*mj.ExpandedURL)) - } else { - buf.WriteString(`{"expanded_url":null`) - } - buf.WriteString(`,"indices":`) - if mj.Indices != nil { - buf.WriteString(`[`) - for i, v := range mj.Indices { - if i != 0 { - buf.WriteString(`,`) - } - fflib.FormatBits2(buf, uint64(v), 10, v < 0) - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"url":`) - fflib.WriteJsonString(buf, string(mj.URL)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_URLbase = iota - ffj_t_URLno_such_key - - ffj_t_URL_ExpandedURL - - ffj_t_URL_Indices - - ffj_t_URL_URL -) - -var ffj_key_URL_ExpandedURL = []byte("expanded_url") - -var ffj_key_URL_Indices = []byte("indices") - -var ffj_key_URL_URL = []byte("url") - -func (uj *URL) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *URL) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_URLbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_URLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'e': - - if bytes.Equal(ffj_key_URL_ExpandedURL, kn) { - currentKey = ffj_t_URL_ExpandedURL - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_URL_Indices, kn) { - currentKey = ffj_t_URL_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_URL_URL, kn) { - currentKey = ffj_t_URL_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_URL_URL, kn) { - currentKey = ffj_t_URL_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_URL_Indices, kn) { - currentKey = ffj_t_URL_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_URL_ExpandedURL, kn) { - currentKey = ffj_t_URL_ExpandedURL - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_URLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_URL_ExpandedURL: - goto handle_ExpandedURL - - case ffj_t_URL_Indices: - goto handle_Indices - - case ffj_t_URL_URL: - goto handle_URL - - case ffj_t_URLno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_ExpandedURL: - - /* handler: uj.ExpandedURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.ExpandedURL = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.ExpandedURL = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Indices: - - /* handler: uj.Indices type=[]int kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Indices = nil - } else { - - uj.Indices = make([]int, 0) - - wantVal := true - - for { - - var tmp_uj__Indices int - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Indices type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - tmp_uj__Indices = int(tval) - - } - } - - uj.Indices = append(uj.Indices, tmp_uj__Indices) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.URL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *User) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *User) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.ContributorsEnabled { - buf.WriteString(`{"contributors_enabled":true`) - } else { - buf.WriteString(`{"contributors_enabled":false`) - } - buf.WriteString(`,"created_at":`) - fflib.WriteJsonString(buf, string(mj.CreatedAt)) - if mj.DefaultProfile { - buf.WriteString(`,"default_profile":true`) - } else { - buf.WriteString(`,"default_profile":false`) - } - if mj.DefaultProfileImage { - buf.WriteString(`,"default_profile_image":true`) - } else { - buf.WriteString(`,"default_profile_image":false`) - } - buf.WriteString(`,"description":`) - fflib.WriteJsonString(buf, string(mj.Description)) - buf.WriteString(`,"entities":`) - - { - - err = mj.Entities.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"favourites_count":`) - fflib.FormatBits2(buf, uint64(mj.FavouritesCount), 10, mj.FavouritesCount < 0) - if mj.FollowRequestSent != nil { - buf.WriteString(`,"follow_request_sent":`) - fflib.WriteJsonString(buf, string(*mj.FollowRequestSent)) - } else { - buf.WriteString(`,"follow_request_sent":null`) - } - buf.WriteString(`,"followers_count":`) - fflib.FormatBits2(buf, uint64(mj.FollowersCount), 10, mj.FollowersCount < 0) - if mj.Following != nil { - buf.WriteString(`,"following":`) - fflib.WriteJsonString(buf, string(*mj.Following)) - } else { - buf.WriteString(`,"following":null`) - } - buf.WriteString(`,"friends_count":`) - fflib.FormatBits2(buf, uint64(mj.FriendsCount), 10, mj.FriendsCount < 0) - if mj.GeoEnabled { - buf.WriteString(`,"geo_enabled":true`) - } else { - buf.WriteString(`,"geo_enabled":false`) - } - buf.WriteString(`,"id":`) - fflib.FormatBits2(buf, uint64(mj.ID), 10, mj.ID < 0) - buf.WriteString(`,"id_str":`) - fflib.WriteJsonString(buf, string(mj.IDStr)) - if mj.IsTranslator { - buf.WriteString(`,"is_translator":true`) - } else { - buf.WriteString(`,"is_translator":false`) - } - buf.WriteString(`,"lang":`) - fflib.WriteJsonString(buf, string(mj.Lang)) - buf.WriteString(`,"listed_count":`) - fflib.FormatBits2(buf, uint64(mj.ListedCount), 10, mj.ListedCount < 0) - buf.WriteString(`,"location":`) - fflib.WriteJsonString(buf, string(mj.Location)) - buf.WriteString(`,"name":`) - fflib.WriteJsonString(buf, string(mj.Name)) - if mj.Notifications != nil { - buf.WriteString(`,"notifications":`) - fflib.WriteJsonString(buf, string(*mj.Notifications)) - } else { - buf.WriteString(`,"notifications":null`) - } - buf.WriteString(`,"profile_background_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundColor)) - buf.WriteString(`,"profile_background_image_url":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundImageURL)) - buf.WriteString(`,"profile_background_image_url_https":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundImageURLHTTPS)) - if mj.ProfileBackgroundTile { - buf.WriteString(`,"profile_background_tile":true`) - } else { - buf.WriteString(`,"profile_background_tile":false`) - } - buf.WriteString(`,"profile_image_url":`) - fflib.WriteJsonString(buf, string(mj.ProfileImageURL)) - buf.WriteString(`,"profile_image_url_https":`) - fflib.WriteJsonString(buf, string(mj.ProfileImageURLHTTPS)) - buf.WriteString(`,"profile_link_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileLinkColor)) - buf.WriteString(`,"profile_sidebar_border_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileSidebarBorderColor)) - buf.WriteString(`,"profile_sidebar_fill_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileSidebarFillColor)) - buf.WriteString(`,"profile_text_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileTextColor)) - if mj.ProfileUseBackgroundImage { - buf.WriteString(`,"profile_use_background_image":true`) - } else { - buf.WriteString(`,"profile_use_background_image":false`) - } - if mj.Protected { - buf.WriteString(`,"protected":true`) - } else { - buf.WriteString(`,"protected":false`) - } - buf.WriteString(`,"screen_name":`) - fflib.WriteJsonString(buf, string(mj.ScreenName)) - if mj.ShowAllInlineMedia { - buf.WriteString(`,"show_all_inline_media":true`) - } else { - buf.WriteString(`,"show_all_inline_media":false`) - } - buf.WriteString(`,"statuses_count":`) - fflib.FormatBits2(buf, uint64(mj.StatusesCount), 10, mj.StatusesCount < 0) - buf.WriteString(`,"time_zone":`) - fflib.WriteJsonString(buf, string(mj.TimeZone)) - if mj.URL != nil { - buf.WriteString(`,"url":`) - fflib.WriteJsonString(buf, string(*mj.URL)) - } else { - buf.WriteString(`,"url":null`) - } - buf.WriteString(`,"utc_offset":`) - fflib.FormatBits2(buf, uint64(mj.UtcOffset), 10, mj.UtcOffset < 0) - if mj.Verified { - buf.WriteString(`,"verified":true`) - } else { - buf.WriteString(`,"verified":false`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Userbase = iota - ffj_t_Userno_such_key - - ffj_t_User_ContributorsEnabled - - ffj_t_User_CreatedAt - - ffj_t_User_DefaultProfile - - ffj_t_User_DefaultProfileImage - - ffj_t_User_Description - - ffj_t_User_Entities - - ffj_t_User_FavouritesCount - - ffj_t_User_FollowRequestSent - - ffj_t_User_FollowersCount - - ffj_t_User_Following - - ffj_t_User_FriendsCount - - ffj_t_User_GeoEnabled - - ffj_t_User_ID - - ffj_t_User_IDStr - - ffj_t_User_IsTranslator - - ffj_t_User_Lang - - ffj_t_User_ListedCount - - ffj_t_User_Location - - ffj_t_User_Name - - ffj_t_User_Notifications - - ffj_t_User_ProfileBackgroundColor - - ffj_t_User_ProfileBackgroundImageURL - - ffj_t_User_ProfileBackgroundImageURLHTTPS - - ffj_t_User_ProfileBackgroundTile - - ffj_t_User_ProfileImageURL - - ffj_t_User_ProfileImageURLHTTPS - - ffj_t_User_ProfileLinkColor - - ffj_t_User_ProfileSidebarBorderColor - - ffj_t_User_ProfileSidebarFillColor - - ffj_t_User_ProfileTextColor - - ffj_t_User_ProfileUseBackgroundImage - - ffj_t_User_Protected - - ffj_t_User_ScreenName - - ffj_t_User_ShowAllInlineMedia - - ffj_t_User_StatusesCount - - ffj_t_User_TimeZone - - ffj_t_User_URL - - ffj_t_User_UtcOffset - - ffj_t_User_Verified -) - -var ffj_key_User_ContributorsEnabled = []byte("contributors_enabled") - -var ffj_key_User_CreatedAt = []byte("created_at") - -var ffj_key_User_DefaultProfile = []byte("default_profile") - -var ffj_key_User_DefaultProfileImage = []byte("default_profile_image") - -var ffj_key_User_Description = []byte("description") - -var ffj_key_User_Entities = []byte("entities") - -var ffj_key_User_FavouritesCount = []byte("favourites_count") - -var ffj_key_User_FollowRequestSent = []byte("follow_request_sent") - -var ffj_key_User_FollowersCount = []byte("followers_count") - -var ffj_key_User_Following = []byte("following") - -var ffj_key_User_FriendsCount = []byte("friends_count") - -var ffj_key_User_GeoEnabled = []byte("geo_enabled") - -var ffj_key_User_ID = []byte("id") - -var ffj_key_User_IDStr = []byte("id_str") - -var ffj_key_User_IsTranslator = []byte("is_translator") - -var ffj_key_User_Lang = []byte("lang") - -var ffj_key_User_ListedCount = []byte("listed_count") - -var ffj_key_User_Location = []byte("location") - -var ffj_key_User_Name = []byte("name") - -var ffj_key_User_Notifications = []byte("notifications") - -var ffj_key_User_ProfileBackgroundColor = []byte("profile_background_color") - -var ffj_key_User_ProfileBackgroundImageURL = []byte("profile_background_image_url") - -var ffj_key_User_ProfileBackgroundImageURLHTTPS = []byte("profile_background_image_url_https") - -var ffj_key_User_ProfileBackgroundTile = []byte("profile_background_tile") - -var ffj_key_User_ProfileImageURL = []byte("profile_image_url") - -var ffj_key_User_ProfileImageURLHTTPS = []byte("profile_image_url_https") - -var ffj_key_User_ProfileLinkColor = []byte("profile_link_color") - -var ffj_key_User_ProfileSidebarBorderColor = []byte("profile_sidebar_border_color") - -var ffj_key_User_ProfileSidebarFillColor = []byte("profile_sidebar_fill_color") - -var ffj_key_User_ProfileTextColor = []byte("profile_text_color") - -var ffj_key_User_ProfileUseBackgroundImage = []byte("profile_use_background_image") - -var ffj_key_User_Protected = []byte("protected") - -var ffj_key_User_ScreenName = []byte("screen_name") - -var ffj_key_User_ShowAllInlineMedia = []byte("show_all_inline_media") - -var ffj_key_User_StatusesCount = []byte("statuses_count") - -var ffj_key_User_TimeZone = []byte("time_zone") - -var ffj_key_User_URL = []byte("url") - -var ffj_key_User_UtcOffset = []byte("utc_offset") - -var ffj_key_User_Verified = []byte("verified") - -func (uj *User) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *User) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Userbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Userno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_User_ContributorsEnabled, kn) { - currentKey = ffj_t_User_ContributorsEnabled - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_CreatedAt, kn) { - currentKey = ffj_t_User_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'd': - - if bytes.Equal(ffj_key_User_DefaultProfile, kn) { - currentKey = ffj_t_User_DefaultProfile - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_DefaultProfileImage, kn) { - currentKey = ffj_t_User_DefaultProfileImage - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Description, kn) { - currentKey = ffj_t_User_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'e': - - if bytes.Equal(ffj_key_User_Entities, kn) { - currentKey = ffj_t_User_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'f': - - if bytes.Equal(ffj_key_User_FavouritesCount, kn) { - currentKey = ffj_t_User_FavouritesCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FollowRequestSent, kn) { - currentKey = ffj_t_User_FollowRequestSent - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FollowersCount, kn) { - currentKey = ffj_t_User_FollowersCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Following, kn) { - currentKey = ffj_t_User_Following - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FriendsCount, kn) { - currentKey = ffj_t_User_FriendsCount - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'g': - - if bytes.Equal(ffj_key_User_GeoEnabled, kn) { - currentKey = ffj_t_User_GeoEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_User_ID, kn) { - currentKey = ffj_t_User_ID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_IDStr, kn) { - currentKey = ffj_t_User_IDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_IsTranslator, kn) { - currentKey = ffj_t_User_IsTranslator - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'l': - - if bytes.Equal(ffj_key_User_Lang, kn) { - currentKey = ffj_t_User_Lang - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ListedCount, kn) { - currentKey = ffj_t_User_ListedCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Location, kn) { - currentKey = ffj_t_User_Location - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'n': - - if bytes.Equal(ffj_key_User_Name, kn) { - currentKey = ffj_t_User_Name - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Notifications, kn) { - currentKey = ffj_t_User_Notifications - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'p': - - if bytes.Equal(ffj_key_User_ProfileBackgroundColor, kn) { - currentKey = ffj_t_User_ProfileBackgroundColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundImageURL, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundTile, kn) { - currentKey = ffj_t_User_ProfileBackgroundTile - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileImageURL, kn) { - currentKey = ffj_t_User_ProfileImageURL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileLinkColor, kn) { - currentKey = ffj_t_User_ProfileLinkColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileSidebarBorderColor, kn) { - currentKey = ffj_t_User_ProfileSidebarBorderColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileSidebarFillColor, kn) { - currentKey = ffj_t_User_ProfileSidebarFillColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileTextColor, kn) { - currentKey = ffj_t_User_ProfileTextColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileUseBackgroundImage, kn) { - currentKey = ffj_t_User_ProfileUseBackgroundImage - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Protected, kn) { - currentKey = ffj_t_User_Protected - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_User_ScreenName, kn) { - currentKey = ffj_t_User_ScreenName - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ShowAllInlineMedia, kn) { - currentKey = ffj_t_User_ShowAllInlineMedia - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_StatusesCount, kn) { - currentKey = ffj_t_User_StatusesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_User_TimeZone, kn) { - currentKey = ffj_t_User_TimeZone - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_User_URL, kn) { - currentKey = ffj_t_User_URL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_UtcOffset, kn) { - currentKey = ffj_t_User_UtcOffset - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'v': - - if bytes.Equal(ffj_key_User_Verified, kn) { - currentKey = ffj_t_User_Verified - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Verified, kn) { - currentKey = ffj_t_User_Verified - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_UtcOffset, kn) { - currentKey = ffj_t_User_UtcOffset - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_URL, kn) { - currentKey = ffj_t_User_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_TimeZone, kn) { - currentKey = ffj_t_User_TimeZone - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_StatusesCount, kn) { - currentKey = ffj_t_User_StatusesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ShowAllInlineMedia, kn) { - currentKey = ffj_t_User_ShowAllInlineMedia - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ScreenName, kn) { - currentKey = ffj_t_User_ScreenName - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Protected, kn) { - currentKey = ffj_t_User_Protected - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileUseBackgroundImage, kn) { - currentKey = ffj_t_User_ProfileUseBackgroundImage - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_ProfileTextColor, kn) { - currentKey = ffj_t_User_ProfileTextColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileSidebarFillColor, kn) { - currentKey = ffj_t_User_ProfileSidebarFillColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileSidebarBorderColor, kn) { - currentKey = ffj_t_User_ProfileSidebarBorderColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileLinkColor, kn) { - currentKey = ffj_t_User_ProfileLinkColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_ProfileImageURL, kn) { - currentKey = ffj_t_User_ProfileImageURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundTile, kn) { - currentKey = ffj_t_User_ProfileBackgroundTile - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundImageURL, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundColor, kn) { - currentKey = ffj_t_User_ProfileBackgroundColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Notifications, kn) { - currentKey = ffj_t_User_Notifications - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Name, kn) { - currentKey = ffj_t_User_Name - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Location, kn) { - currentKey = ffj_t_User_Location - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ListedCount, kn) { - currentKey = ffj_t_User_ListedCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Lang, kn) { - currentKey = ffj_t_User_Lang - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_IsTranslator, kn) { - currentKey = ffj_t_User_IsTranslator - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_IDStr, kn) { - currentKey = ffj_t_User_IDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_ID, kn) { - currentKey = ffj_t_User_ID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_GeoEnabled, kn) { - currentKey = ffj_t_User_GeoEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FriendsCount, kn) { - currentKey = ffj_t_User_FriendsCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Following, kn) { - currentKey = ffj_t_User_Following - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FollowersCount, kn) { - currentKey = ffj_t_User_FollowersCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FollowRequestSent, kn) { - currentKey = ffj_t_User_FollowRequestSent - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FavouritesCount, kn) { - currentKey = ffj_t_User_FavouritesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Entities, kn) { - currentKey = ffj_t_User_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Description, kn) { - currentKey = ffj_t_User_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_DefaultProfileImage, kn) { - currentKey = ffj_t_User_DefaultProfileImage - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_DefaultProfile, kn) { - currentKey = ffj_t_User_DefaultProfile - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_CreatedAt, kn) { - currentKey = ffj_t_User_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ContributorsEnabled, kn) { - currentKey = ffj_t_User_ContributorsEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Userno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_User_ContributorsEnabled: - goto handle_ContributorsEnabled - - case ffj_t_User_CreatedAt: - goto handle_CreatedAt - - case ffj_t_User_DefaultProfile: - goto handle_DefaultProfile - - case ffj_t_User_DefaultProfileImage: - goto handle_DefaultProfileImage - - case ffj_t_User_Description: - goto handle_Description - - case ffj_t_User_Entities: - goto handle_Entities - - case ffj_t_User_FavouritesCount: - goto handle_FavouritesCount - - case ffj_t_User_FollowRequestSent: - goto handle_FollowRequestSent - - case ffj_t_User_FollowersCount: - goto handle_FollowersCount - - case ffj_t_User_Following: - goto handle_Following - - case ffj_t_User_FriendsCount: - goto handle_FriendsCount - - case ffj_t_User_GeoEnabled: - goto handle_GeoEnabled - - case ffj_t_User_ID: - goto handle_ID - - case ffj_t_User_IDStr: - goto handle_IDStr - - case ffj_t_User_IsTranslator: - goto handle_IsTranslator - - case ffj_t_User_Lang: - goto handle_Lang - - case ffj_t_User_ListedCount: - goto handle_ListedCount - - case ffj_t_User_Location: - goto handle_Location - - case ffj_t_User_Name: - goto handle_Name - - case ffj_t_User_Notifications: - goto handle_Notifications - - case ffj_t_User_ProfileBackgroundColor: - goto handle_ProfileBackgroundColor - - case ffj_t_User_ProfileBackgroundImageURL: - goto handle_ProfileBackgroundImageURL - - case ffj_t_User_ProfileBackgroundImageURLHTTPS: - goto handle_ProfileBackgroundImageURLHTTPS - - case ffj_t_User_ProfileBackgroundTile: - goto handle_ProfileBackgroundTile - - case ffj_t_User_ProfileImageURL: - goto handle_ProfileImageURL - - case ffj_t_User_ProfileImageURLHTTPS: - goto handle_ProfileImageURLHTTPS - - case ffj_t_User_ProfileLinkColor: - goto handle_ProfileLinkColor - - case ffj_t_User_ProfileSidebarBorderColor: - goto handle_ProfileSidebarBorderColor - - case ffj_t_User_ProfileSidebarFillColor: - goto handle_ProfileSidebarFillColor - - case ffj_t_User_ProfileTextColor: - goto handle_ProfileTextColor - - case ffj_t_User_ProfileUseBackgroundImage: - goto handle_ProfileUseBackgroundImage - - case ffj_t_User_Protected: - goto handle_Protected - - case ffj_t_User_ScreenName: - goto handle_ScreenName - - case ffj_t_User_ShowAllInlineMedia: - goto handle_ShowAllInlineMedia - - case ffj_t_User_StatusesCount: - goto handle_StatusesCount - - case ffj_t_User_TimeZone: - goto handle_TimeZone - - case ffj_t_User_URL: - goto handle_URL - - case ffj_t_User_UtcOffset: - goto handle_UtcOffset - - case ffj_t_User_Verified: - goto handle_Verified - - case ffj_t_Userno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_ContributorsEnabled: - - /* handler: uj.ContributorsEnabled type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ContributorsEnabled = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ContributorsEnabled = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_CreatedAt: - - /* handler: uj.CreatedAt type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.CreatedAt = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_DefaultProfile: - - /* handler: uj.DefaultProfile type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.DefaultProfile = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.DefaultProfile = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_DefaultProfileImage: - - /* handler: uj.DefaultProfileImage type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.DefaultProfileImage = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.DefaultProfileImage = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Description: - - /* handler: uj.Description type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Description = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Entities: - - /* handler: uj.Entities type=benchmark.UserEntities kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Entities.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FavouritesCount: - - /* handler: uj.FavouritesCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FavouritesCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FollowRequestSent: - - /* handler: uj.FollowRequestSent type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.FollowRequestSent = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.FollowRequestSent = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FollowersCount: - - /* handler: uj.FollowersCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FollowersCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Following: - - /* handler: uj.Following type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Following = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Following = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FriendsCount: - - /* handler: uj.FriendsCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FriendsCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_GeoEnabled: - - /* handler: uj.GeoEnabled type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.GeoEnabled = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.GeoEnabled = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ID: - - /* handler: uj.ID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IDStr: - - /* handler: uj.IDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IsTranslator: - - /* handler: uj.IsTranslator type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.IsTranslator = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.IsTranslator = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Lang: - - /* handler: uj.Lang type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Lang = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ListedCount: - - /* handler: uj.ListedCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ListedCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Location: - - /* handler: uj.Location type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Location = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Name: - - /* handler: uj.Name type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Name = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Notifications: - - /* handler: uj.Notifications type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Notifications = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Notifications = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundColor: - - /* handler: uj.ProfileBackgroundColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundImageURL: - - /* handler: uj.ProfileBackgroundImageURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundImageURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundImageURLHTTPS: - - /* handler: uj.ProfileBackgroundImageURLHTTPS type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundImageURLHTTPS = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundTile: - - /* handler: uj.ProfileBackgroundTile type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ProfileBackgroundTile = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ProfileBackgroundTile = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileImageURL: - - /* handler: uj.ProfileImageURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileImageURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileImageURLHTTPS: - - /* handler: uj.ProfileImageURLHTTPS type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileImageURLHTTPS = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileLinkColor: - - /* handler: uj.ProfileLinkColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileLinkColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileSidebarBorderColor: - - /* handler: uj.ProfileSidebarBorderColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileSidebarBorderColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileSidebarFillColor: - - /* handler: uj.ProfileSidebarFillColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileSidebarFillColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileTextColor: - - /* handler: uj.ProfileTextColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileTextColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileUseBackgroundImage: - - /* handler: uj.ProfileUseBackgroundImage type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ProfileUseBackgroundImage = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ProfileUseBackgroundImage = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Protected: - - /* handler: uj.Protected type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Protected = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Protected = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ScreenName: - - /* handler: uj.ScreenName type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ScreenName = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ShowAllInlineMedia: - - /* handler: uj.ShowAllInlineMedia type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ShowAllInlineMedia = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ShowAllInlineMedia = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_StatusesCount: - - /* handler: uj.StatusesCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.StatusesCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_TimeZone: - - /* handler: uj.TimeZone type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.TimeZone = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.URL = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.URL = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_UtcOffset: - - /* handler: uj.UtcOffset type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.UtcOffset = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Verified: - - /* handler: uj.Verified type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Verified = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Verified = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntities) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntities) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"description":`) - - { - - err = mj.Description.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"url":`) - - { - - err = mj.URL.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntitiesbase = iota - ffj_t_UserEntitiesno_such_key - - ffj_t_UserEntities_Description - - ffj_t_UserEntities_URL -) - -var ffj_key_UserEntities_Description = []byte("description") - -var ffj_key_UserEntities_URL = []byte("url") - -func (uj *UserEntities) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntities) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntitiesbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'd': - - if bytes.Equal(ffj_key_UserEntities_Description, kn) { - currentKey = ffj_t_UserEntities_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_UserEntities_URL, kn) { - currentKey = ffj_t_UserEntities_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_UserEntities_URL, kn) { - currentKey = ffj_t_UserEntities_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_UserEntities_Description, kn) { - currentKey = ffj_t_UserEntities_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntities_Description: - goto handle_Description - - case ffj_t_UserEntities_URL: - goto handle_URL - - case ffj_t_UserEntitiesno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Description: - - /* handler: uj.Description type=benchmark.UserEntityDescription kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Description.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=benchmark.UserEntityURL kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.URL.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntityDescription) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntityDescription) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntityDescriptionbase = iota - ffj_t_UserEntityDescriptionno_such_key - - ffj_t_UserEntityDescription_Urls -) - -var ffj_key_UserEntityDescription_Urls = []byte("urls") - -func (uj *UserEntityDescription) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntityDescription) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntityDescriptionbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntityDescriptionno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'u': - - if bytes.Equal(ffj_key_UserEntityDescription_Urls, kn) { - currentKey = ffj_t_UserEntityDescription_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_UserEntityDescription_Urls, kn) { - currentKey = ffj_t_UserEntityDescription_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntityDescriptionno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntityDescription_Urls: - goto handle_Urls - - case ffj_t_UserEntityDescriptionno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Urls: - - /* handler: uj.Urls type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__Urls *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__Urls = nil - } else { - if tmp_uj__Urls == nil { - tmp_uj__Urls = new(string) - } - - /* handler: tmp_uj__Urls type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__Urls = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__Urls = &tval - - } - } - - } - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntityURL) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntityURL) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntityURLbase = iota - ffj_t_UserEntityURLno_such_key - - ffj_t_UserEntityURL_Urls -) - -var ffj_key_UserEntityURL_Urls = []byte("urls") - -func (uj *UserEntityURL) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntityURL) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntityURLbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntityURLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'u': - - if bytes.Equal(ffj_key_UserEntityURL_Urls, kn) { - currentKey = ffj_t_UserEntityURL_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_UserEntityURL_Urls, kn) { - currentKey = ffj_t_UserEntityURL_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntityURLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntityURL_Urls: - goto handle_Urls - - case ffj_t_UserEntityURLno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Urls: - - /* handler: uj.Urls type=[]benchmark.URL kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]URL, 0) - - wantVal := true - - for { - - var tmp_uj__Urls URL - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=benchmark.URL kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Urls.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *XLStruct) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *XLStruct) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"Data":`) - if mj.Data != nil { - buf.WriteString(`[`) - for i, v := range mj.Data { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_XLStructbase = iota - ffj_t_XLStructno_such_key - - ffj_t_XLStruct_Data -) - -var ffj_key_XLStruct_Data = []byte("Data") - -func (uj *XLStruct) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *XLStruct) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_XLStructbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_XLStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'D': - - if bytes.Equal(ffj_key_XLStruct_Data, kn) { - currentKey = ffj_t_XLStruct_Data - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_XLStruct_Data, kn) { - currentKey = ffj_t_XLStruct_Data - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_XLStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_XLStruct_Data: - goto handle_Data - - case ffj_t_XLStructno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Data: - - /* handler: uj.Data type=[]benchmark.LargeStruct kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Data = nil - } else { - - uj.Data = make([]LargeStruct, 0) - - wantVal := true - - for { - - var tmp_uj__Data LargeStruct - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Data type=benchmark.LargeStruct kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Data.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Data = append(uj.Data, tmp_uj__Data) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} diff --git a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_var.go b/cmd/vendor/github.com/mailru/easyjson/benchmark/data_var.go deleted file mode 100644 index ea4202dbe2..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/benchmark/data_var.go +++ /dev/null @@ -1,350 +0,0 @@ -package benchmark - -var largeStructData = LargeStruct{ - SearchMetadata: SearchMetadata{ - CompletedIn: 0.035, - Count: 4, - MaxID: 250126199840518145, - MaxIDStr: "250126199840518145", - NextResults: "?max_id=249279667666817023&q=%23freebandnames&count=4&include_entities=1&result_type=mixed", - Query: "%23freebandnames", - RefreshURL: "?since_id=250126199840518145&q=%23freebandnames&result_type=mixed&include_entities=1", - SinceID: 24012619984051000, - SinceIDStr: "24012619984051000", - }, - Statuses: []Status{ - { - Contributors: nil, - Coordinates: nil, - CreatedAt: "Mon Sep 24 03:35:21 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "freebandnames"}, - }, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 250075927172759552, - IDStr: "250075927172759552", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "Twitter for Mac", - Text: "Aggressive Ponytail #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Mon Apr 26 06:01:55 +0000 2010", - DefaultProfile: true, - DefaultProfileImage: false, - Description: "Born 330 Live 310", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: []*string{}, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 0}, - URL: "", - }}, - }, - }, - FavouritesCount: 0, - FollowRequestSent: nil, - FollowersCount: 70, - Following: nil, - FriendsCount: 110, - GeoEnabled: true, - ID: 137238150, - IDStr: "137238150", - IsTranslator: false, - Lang: "en", - ListedCount: 2, - Location: "LA, CA", - Name: "Sean Cummings", - Notifications: nil, - ProfileBackgroundColor: "C0DEED", - ProfileBackgroundImageURL: "http://a0.twimg.com/images/themes/theme1/bg.png", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/images/themes/theme1/bg.png", - ProfileBackgroundTile: false, - ProfileImageURL: "http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - ProfileLinkColor: "0084B4", - ProfileSidebarBorderColor: "C0DEED", - ProfileSidebarFillColor: "DDEEF6", - ProfileTextColor: "333333", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "sean_cummings", - ShowAllInlineMedia: false, - StatusesCount: 579, - TimeZone: "Pacific Time (US & Canada)", - URL: nil, - UtcOffset: -28800, - Verified: false, - }, - }, - { - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 23:40:54 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "FreeBandNames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249292149810667520, - IDStr: "249292149810667520", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "pl", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "web", - Text: "Thee Namaste Nerdz. #FreeBandNames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Tue Apr 07 19:05:07 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "You will come to Durham, North Carolina. I will sell you some records then, here in Durham, North Carolina. Fun will happen.", - Entities: UserEntities{ - Description: UserEntityDescription{Urls: []*string{}}, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 32}, - URL: "http://bullcityrecords.com/wnng/"}}, - }, - }, - FavouritesCount: 8, - FollowRequestSent: nil, - FollowersCount: 2052, - Following: nil, - FriendsCount: 348, - GeoEnabled: false, - ID: 29516238, - IDStr: "29516238", - IsTranslator: false, - Lang: "en", - ListedCount: 118, - Location: "Durham, NC", - Name: "Chaz Martenstein", - Notifications: nil, - ProfileBackgroundColor: "9AE4E8", - ProfileBackgroundImageURL: "http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp", - ProfileBackgroundTile: true, - ProfileImageURL: "http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - ProfileLinkColor: "0084B4", - ProfileSidebarBorderColor: "BDDCAD", - ProfileSidebarFillColor: "DDFFCC", - ProfileTextColor: "333333", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "bullcityrecords", - ShowAllInlineMedia: true, - StatusesCount: 7579, - TimeZone: "Eastern Time (US & Canada)", - URL: nil, - UtcOffset: -18000, - Verified: false, - }, - }, - Status{ - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 23:30:20 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{29, 43}, - Text: "freebandnames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249289491129438208, - IDStr: "249289491129438208", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "web", - Text: "Mexican Heaven, Mexican Hell #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Tue Sep 01 21:21:35 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "Science Fiction Writer, sort of. Likes Superheroes, Mole People, Alt. Timelines.", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: nil, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 0}, - URL: "", - }}, - }, - }, - FavouritesCount: 19, - FollowRequestSent: nil, - FollowersCount: 63, - Following: nil, - FriendsCount: 63, - GeoEnabled: false, - ID: 70789458, - IDStr: "70789458", - IsTranslator: false, - Lang: "en", - ListedCount: 1, - Location: "Kingston New York", - Name: "Thomas John Wakeman", - Notifications: nil, - ProfileBackgroundColor: "352726", - ProfileBackgroundImageURL: "http://a0.twimg.com/images/themes/theme5/bg.gif", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/images/themes/theme5/bg.gif", - ProfileBackgroundTile: false, - ProfileImageURL: "http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - ProfileLinkColor: "D02B55", - ProfileSidebarBorderColor: "829D5E", - ProfileSidebarFillColor: "99CC33", - ProfileTextColor: "3E4415", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "MonkiesFist", - ShowAllInlineMedia: false, - StatusesCount: 1048, - TimeZone: "Eastern Time (US & Canada)", - URL: nil, - UtcOffset: -18000, - Verified: false, - }, - }, - Status{ - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 22:51:18 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "freebandnames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249279667666817024, - IDStr: "249279667666817024", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "Twitter for iPhone", - Text: "The Foolish Mortals #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Mon May 04 00:05:00 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "Cartoonist, Illustrator, and T-Shirt connoisseur", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: []*string{}, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 24}, - URL: "http://www.omnitarian.me", - }}, - }, - }, - FavouritesCount: 647, - FollowRequestSent: nil, - FollowersCount: 608, - Following: nil, - FriendsCount: 249, - GeoEnabled: false, - ID: 37539828, - IDStr: "37539828", - IsTranslator: false, - Lang: "en", - ListedCount: 52, - Location: "Wisconsin, USA", - Name: "Marty Elmer", - Notifications: nil, - ProfileBackgroundColor: "EEE3C4", - ProfileBackgroundImageURL: "http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png", - ProfileBackgroundTile: true, - ProfileImageURL: "http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - ProfileLinkColor: "3B2A26", - ProfileSidebarBorderColor: "615A44", - ProfileSidebarFillColor: "BFAC83", - ProfileTextColor: "000000", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "Omnitarian", - ShowAllInlineMedia: true, - StatusesCount: 3575, - TimeZone: "Central Time (US & Canada)", - URL: nil, - UtcOffset: -21600, - Verified: false, - }, - }, - }, -} diff --git a/cmd/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go b/cmd/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go deleted file mode 100644 index 3c20e09ca6..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go +++ /dev/null @@ -1,188 +0,0 @@ -// Package bootstrap implements the bootstrapping logic: generation of a .go file to -// launch the actual generator and launching the generator itself. -// -// The package may be preferred to a command-line utility if generating the serializers -// from golang code is required. -package bootstrap - -import ( - "fmt" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "sort" -) - -const genPackage = "github.com/mailru/easyjson/gen" -const pkgWriter = "github.com/mailru/easyjson/jwriter" -const pkgLexer = "github.com/mailru/easyjson/jlexer" - -type Generator struct { - PkgPath, PkgName string - Types []string - - NoStdMarshalers bool - SnakeCase bool - LowerCamelCase bool - OmitEmpty bool - - OutName string - BuildTags string - - StubsOnly bool - LeaveTemps bool - NoFormat bool -} - -// writeStub outputs an initial stubs for marshalers/unmarshalers so that the package -// using marshalers/unmarshales compiles correctly for boostrapping code. -func (g *Generator) writeStub() error { - f, err := os.Create(g.OutName) - if err != nil { - return err - } - defer f.Close() - - if g.BuildTags != "" { - fmt.Fprintln(f, "// +build ", g.BuildTags) - fmt.Fprintln(f) - } - fmt.Fprintln(f, "// TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package") - fmt.Fprintln(f, "// compilable during generation.") - fmt.Fprintln(f) - fmt.Fprintln(f, "package ", g.PkgName) - - if len(g.Types) > 0 { - fmt.Fprintln(f) - fmt.Fprintln(f, "import (") - fmt.Fprintln(f, ` "`+pkgWriter+`"`) - fmt.Fprintln(f, ` "`+pkgLexer+`"`) - fmt.Fprintln(f, ")") - } - - sort.Strings(g.Types) - for _, t := range g.Types { - fmt.Fprintln(f) - if !g.NoStdMarshalers { - fmt.Fprintln(f, "func (", t, ") MarshalJSON() ([]byte, error) { return nil, nil }") - fmt.Fprintln(f, "func (*", t, ") UnmarshalJSON([]byte) error { return nil }") - } - - fmt.Fprintln(f, "func (", t, ") MarshalEasyJSON(w *jwriter.Writer) {}") - fmt.Fprintln(f, "func (*", t, ") UnmarshalEasyJSON(l *jlexer.Lexer) {}") - fmt.Fprintln(f) - fmt.Fprintln(f, "type EasyJSON_exporter_"+t+" *"+t) - } - return nil -} - -// writeMain creates a .go file that launches the generator if 'go run'. -func (g *Generator) writeMain() (path string, err error) { - f, err := ioutil.TempFile(filepath.Dir(g.OutName), "easyjson-bootstrap") - if err != nil { - return "", err - } - - fmt.Fprintln(f, "// +build ignore") - fmt.Fprintln(f) - fmt.Fprintln(f, "// TEMPORARY AUTOGENERATED FILE: easyjson bootstapping code to launch") - fmt.Fprintln(f, "// the actual generator.") - fmt.Fprintln(f) - fmt.Fprintln(f, "package main") - fmt.Fprintln(f) - fmt.Fprintln(f, "import (") - fmt.Fprintln(f, ` "fmt"`) - fmt.Fprintln(f, ` "os"`) - fmt.Fprintln(f) - fmt.Fprintf(f, " %q\n", genPackage) - if len(g.Types) > 0 { - fmt.Fprintln(f) - fmt.Fprintf(f, " pkg %q\n", g.PkgPath) - } - fmt.Fprintln(f, ")") - fmt.Fprintln(f) - fmt.Fprintln(f, "func main() {") - fmt.Fprintf(f, " g := gen.NewGenerator(%q)\n", filepath.Base(g.OutName)) - fmt.Fprintf(f, " g.SetPkg(%q, %q)\n", g.PkgName, g.PkgPath) - if g.BuildTags != "" { - fmt.Fprintf(f, " g.SetBuildTags(%q)\n", g.BuildTags) - } - if g.SnakeCase { - fmt.Fprintln(f, " g.UseSnakeCase()") - } - if g.LowerCamelCase { - fmt.Fprintln(f, " g.UseLowerCamelCase()") - } - if g.OmitEmpty { - fmt.Fprintln(f, " g.OmitEmpty()") - } - if g.NoStdMarshalers { - fmt.Fprintln(f, " g.NoStdMarshalers()") - } - - sort.Strings(g.Types) - for _, v := range g.Types { - fmt.Fprintln(f, " g.Add(pkg.EasyJSON_exporter_"+v+"(nil))") - } - - fmt.Fprintln(f, " if err := g.Run(os.Stdout); err != nil {") - fmt.Fprintln(f, " fmt.Fprintln(os.Stderr, err)") - fmt.Fprintln(f, " os.Exit(1)") - fmt.Fprintln(f, " }") - fmt.Fprintln(f, "}") - - src := f.Name() - if err := f.Close(); err != nil { - return src, err - } - - dest := src + ".go" - return dest, os.Rename(src, dest) -} - -func (g *Generator) Run() error { - if err := g.writeStub(); err != nil { - return err - } - if g.StubsOnly { - return nil - } - - path, err := g.writeMain() - if err != nil { - return err - } - if !g.LeaveTemps { - defer os.Remove(path) - } - - f, err := os.Create(g.OutName + ".tmp") - if err != nil { - return err - } - if !g.LeaveTemps { - defer os.Remove(f.Name()) // will not remove after rename - } - - cmd := exec.Command("go", "run", "-tags", g.BuildTags, path) - cmd.Stdout = f - cmd.Stderr = os.Stderr - if err = cmd.Run(); err != nil { - return err - } - - f.Close() - - if !g.NoFormat { - cmd = exec.Command("gofmt", "-w", f.Name()) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - - if err = cmd.Run(); err != nil { - return err - } - } - - return os.Rename(f.Name(), g.OutName) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/buffer/pool.go b/cmd/vendor/github.com/mailru/easyjson/buffer/pool.go deleted file mode 100644 index 07fb4bc1f7..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/buffer/pool.go +++ /dev/null @@ -1,270 +0,0 @@ -// Package buffer implements a buffer for serialization, consisting of a chain of []byte-s to -// reduce copying and to allow reuse of individual chunks. -package buffer - -import ( - "io" - "sync" -) - -// PoolConfig contains configuration for the allocation and reuse strategy. -type PoolConfig struct { - StartSize int // Minimum chunk size that is allocated. - PooledSize int // Minimum chunk size that is reused, reusing chunks too small will result in overhead. - MaxSize int // Maximum chunk size that will be allocated. -} - -var config = PoolConfig{ - StartSize: 128, - PooledSize: 512, - MaxSize: 32768, -} - -// Reuse pool: chunk size -> pool. -var buffers = map[int]*sync.Pool{} - -func initBuffers() { - for l := config.PooledSize; l <= config.MaxSize; l *= 2 { - buffers[l] = new(sync.Pool) - } -} - -func init() { - initBuffers() -} - -// Init sets up a non-default pooling and allocation strategy. Should be run before serialization is done. -func Init(cfg PoolConfig) { - config = cfg - initBuffers() -} - -// putBuf puts a chunk to reuse pool if it can be reused. -func putBuf(buf []byte) { - size := cap(buf) - if size < config.PooledSize { - return - } - if c := buffers[size]; c != nil { - c.Put(buf[:0]) - } -} - -// getBuf gets a chunk from reuse pool or creates a new one if reuse failed. -func getBuf(size int) []byte { - if size < config.PooledSize { - return make([]byte, 0, size) - } - - if c := buffers[size]; c != nil { - v := c.Get() - if v != nil { - return v.([]byte) - } - } - return make([]byte, 0, size) -} - -// Buffer is a buffer optimized for serialization without extra copying. -type Buffer struct { - - // Buf is the current chunk that can be used for serialization. - Buf []byte - - toPool []byte - bufs [][]byte -} - -// EnsureSpace makes sure that the current chunk contains at least s free bytes, -// possibly creating a new chunk. -func (b *Buffer) EnsureSpace(s int) { - if cap(b.Buf)-len(b.Buf) >= s { - return - } - l := len(b.Buf) - if l > 0 { - if cap(b.toPool) != cap(b.Buf) { - // Chunk was reallocated, toPool can be pooled. - putBuf(b.toPool) - } - if cap(b.bufs) == 0 { - b.bufs = make([][]byte, 0, 8) - } - b.bufs = append(b.bufs, b.Buf) - l = cap(b.toPool) * 2 - } else { - l = config.StartSize - } - - if l > config.MaxSize { - l = config.MaxSize - } - b.Buf = getBuf(l) - b.toPool = b.Buf -} - -// AppendByte appends a single byte to buffer. -func (b *Buffer) AppendByte(data byte) { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - b.Buf = append(b.Buf, data) -} - -// AppendBytes appends a byte slice to buffer. -func (b *Buffer) AppendBytes(data []byte) { - for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// AppendBytes appends a string to buffer. -func (b *Buffer) AppendString(data string) { - for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// Size computes the size of a buffer by adding sizes of every chunk. -func (b *Buffer) Size() int { - size := len(b.Buf) - for _, buf := range b.bufs { - size += len(buf) - } - return size -} - -// DumpTo outputs the contents of a buffer to a writer and resets the buffer. -func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { - var n int - for _, buf := range b.bufs { - if err == nil { - n, err = w.Write(buf) - written += n - } - putBuf(buf) - } - - if err == nil { - n, err = w.Write(b.Buf) - written += n - } - putBuf(b.toPool) - - b.bufs = nil - b.Buf = nil - b.toPool = nil - - return -} - -// BuildBytes creates a single byte slice with all the contents of the buffer. Data is -// copied if it does not fit in a single chunk. You can optionally provide one byte -// slice as argument that it will try to reuse. -func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { - if len(b.bufs) == 0 { - ret := b.Buf - b.toPool = nil - b.Buf = nil - return ret - } - - var ret []byte - size := b.Size() - - // If we got a buffer as argument and it is big enought, reuse it. - if len(reuse) == 1 && cap(reuse[0]) >= size { - ret = reuse[0][:0] - } else { - ret = make([]byte, 0, size) - } - for _, buf := range b.bufs { - ret = append(ret, buf...) - putBuf(buf) - } - - ret = append(ret, b.Buf...) - putBuf(b.toPool) - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} - -type readCloser struct { - offset int - bufs [][]byte -} - -func (r *readCloser) Read(p []byte) (n int, err error) { - for _, buf := range r.bufs { - // Copy as much as we can. - x := copy(p[n:], buf[r.offset:]) - n += x // Increment how much we filled. - - // Did we empty the whole buffer? - if r.offset+x == len(buf) { - // On to the next buffer. - r.offset = 0 - r.bufs = r.bufs[1:] - - // We can release this buffer. - putBuf(buf) - } else { - r.offset += x - } - - if n == len(p) { - break - } - } - // No buffers left or nothing read? - if len(r.bufs) == 0 { - err = io.EOF - } - return -} - -func (r *readCloser) Close() error { - // Release all remaining buffers. - for _, buf := range r.bufs { - putBuf(buf) - } - // In case Close gets called multiple times. - r.bufs = nil - - return nil -} - -// ReadCloser creates an io.ReadCloser with all the contents of the buffer. -func (b *Buffer) ReadCloser() io.ReadCloser { - ret := &readCloser{0, append(b.bufs, b.Buf)} - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} diff --git a/cmd/vendor/github.com/mailru/easyjson/easyjson/main.go b/cmd/vendor/github.com/mailru/easyjson/easyjson/main.go deleted file mode 100644 index 1cd30bb363..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/easyjson/main.go +++ /dev/null @@ -1,106 +0,0 @@ -package main - -import ( - "errors" - "flag" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/mailru/easyjson/bootstrap" - // Reference the gen package to be friendly to vendoring tools, - // as it is an indirect dependency. - // (The temporary bootstrapping code uses it.) - _ "github.com/mailru/easyjson/gen" - "github.com/mailru/easyjson/parser" -) - -var buildTags = flag.String("build_tags", "", "build tags to add to generated file") -var snakeCase = flag.Bool("snake_case", false, "use snake_case names instead of CamelCase by default") -var lowerCamelCase = flag.Bool("lower_camel_case", false, "use lowerCamelCase names instead of CamelCase by default") -var noStdMarshalers = flag.Bool("no_std_marshalers", false, "don't generate MarshalJSON/UnmarshalJSON funcs") -var omitEmpty = flag.Bool("omit_empty", false, "omit empty fields by default") -var allStructs = flag.Bool("all", false, "generate marshaler/unmarshalers for all structs in a file") -var leaveTemps = flag.Bool("leave_temps", false, "do not delete temporary files") -var stubs = flag.Bool("stubs", false, "only generate stubs for marshaler/unmarshaler funcs") -var noformat = flag.Bool("noformat", false, "do not run 'gofmt -w' on output file") -var specifiedName = flag.String("output_filename", "", "specify the filename of the output") -var processPkg = flag.Bool("pkg", false, "process the whole package instead of just the given file") - -func generate(fname string) (err error) { - fInfo, err := os.Stat(fname) - if err != nil { - return err - } - - p := parser.Parser{AllStructs: *allStructs} - if err := p.Parse(fname, fInfo.IsDir()); err != nil { - return fmt.Errorf("Error parsing %v: %v", fname, err) - } - - var outName string - if fInfo.IsDir() { - outName = filepath.Join(fname, p.PkgName+"_easyjson.go") - } else { - if s := strings.TrimSuffix(fname, ".go"); s == fname { - return errors.New("Filename must end in '.go'") - } else { - outName = s + "_easyjson.go" - } - } - - if *specifiedName != "" { - outName = *specifiedName - } - - var trimmedBuildTags string - if *buildTags != "" { - trimmedBuildTags = strings.TrimSpace(*buildTags) - } - - g := bootstrap.Generator{ - BuildTags: trimmedBuildTags, - PkgPath: p.PkgPath, - PkgName: p.PkgName, - Types: p.StructNames, - SnakeCase: *snakeCase, - LowerCamelCase: *lowerCamelCase, - NoStdMarshalers: *noStdMarshalers, - OmitEmpty: *omitEmpty, - LeaveTemps: *leaveTemps, - OutName: outName, - StubsOnly: *stubs, - NoFormat: *noformat, - } - - if err := g.Run(); err != nil { - return fmt.Errorf("Bootstrap failed: %v", err) - } - return nil -} - -func main() { - flag.Parse() - - files := flag.Args() - - gofile := os.Getenv("GOFILE") - if *processPkg { - gofile = filepath.Dir(gofile) - } - - if len(files) == 0 && gofile != "" { - files = []string{gofile} - } else if len(files) == 0 { - flag.Usage() - os.Exit(1) - } - - for _, fname := range files { - if err := generate(fname); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - } -} diff --git a/cmd/vendor/github.com/mailru/easyjson/gen/decoder.go b/cmd/vendor/github.com/mailru/easyjson/gen/decoder.go deleted file mode 100644 index 021933ac8f..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/gen/decoder.go +++ /dev/null @@ -1,489 +0,0 @@ -package gen - -import ( - "encoding" - "encoding/json" - "fmt" - "reflect" - "strings" - "unicode" - - "github.com/mailru/easyjson" -) - -// Target this byte size for initial slice allocation to reduce garbage collection. -const minSliceBytes = 64 - -func (g *Generator) getDecoderName(t reflect.Type) string { - return g.functionName("decode", t) -} - -var primitiveDecoders = map[reflect.Kind]string{ - reflect.String: "in.String()", - reflect.Bool: "in.Bool()", - reflect.Int: "in.Int()", - reflect.Int8: "in.Int8()", - reflect.Int16: "in.Int16()", - reflect.Int32: "in.Int32()", - reflect.Int64: "in.Int64()", - reflect.Uint: "in.Uint()", - reflect.Uint8: "in.Uint8()", - reflect.Uint16: "in.Uint16()", - reflect.Uint32: "in.Uint32()", - reflect.Uint64: "in.Uint64()", - reflect.Float32: "in.Float32()", - reflect.Float64: "in.Float64()", -} - -var primitiveStringDecoders = map[reflect.Kind]string{ - reflect.String: "in.String()", - reflect.Int: "in.IntStr()", - reflect.Int8: "in.Int8Str()", - reflect.Int16: "in.Int16Str()", - reflect.Int32: "in.Int32Str()", - reflect.Int64: "in.Int64Str()", - reflect.Uint: "in.UintStr()", - reflect.Uint8: "in.Uint8Str()", - reflect.Uint16: "in.Uint16Str()", - reflect.Uint32: "in.Uint32Str()", - reflect.Uint64: "in.Uint64Str()", - reflect.Uintptr: "in.UintptrStr()", -} - -var customDecoders = map[string]string{ - "json.Number": "in.JsonNumber()", -} - -// genTypeDecoder generates decoding code for the type t, but uses unmarshaler interface if implemented by t. -func (g *Generator) genTypeDecoder(t reflect.Type, out string, tags fieldTags, indent int) error { - ws := strings.Repeat(" ", indent) - - unmarshalerIface := reflect.TypeOf((*easyjson.Unmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"("+out+").UnmarshalEasyJSON(in)") - return nil - } - - unmarshalerIface = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"if data := in.Raw(); in.Ok() {") - fmt.Fprintln(g.out, ws+" in.AddError( ("+out+").UnmarshalJSON(data) )") - fmt.Fprintln(g.out, ws+"}") - return nil - } - - unmarshalerIface = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"if data := in.UnsafeBytes(); in.Ok() {") - fmt.Fprintln(g.out, ws+" in.AddError( ("+out+").UnmarshalText(data) )") - fmt.Fprintln(g.out, ws+"}") - return nil - } - - err := g.genTypeDecoderNoCheck(t, out, tags, indent) - return err -} - -// genTypeDecoderNoCheck generates decoding code for the type t. -func (g *Generator) genTypeDecoderNoCheck(t reflect.Type, out string, tags fieldTags, indent int) error { - ws := strings.Repeat(" ", indent) - // Check whether type is primitive, needs to be done after interface check. - if dec := customDecoders[t.String()]; dec != "" { - fmt.Fprintln(g.out, ws+out+" = "+dec) - return nil - } else if dec := primitiveStringDecoders[t.Kind()]; dec != "" && tags.asString { - fmt.Fprintln(g.out, ws+out+" = "+g.getType(t)+"("+dec+")") - return nil - } else if dec := primitiveDecoders[t.Kind()]; dec != "" { - fmt.Fprintln(g.out, ws+out+" = "+g.getType(t)+"("+dec+")") - return nil - } - - switch t.Kind() { - case reflect.Slice: - tmpVar := g.uniqueVarName() - elem := t.Elem() - - if elem.Kind() == reflect.Uint8 { - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" "+out+" = in.Bytes()") - fmt.Fprintln(g.out, ws+"}") - - } else { - - capacity := minSliceBytes / elem.Size() - if capacity == 0 { - capacity = 1 - } - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('[')") - fmt.Fprintln(g.out, ws+" if "+out+" == nil {") - fmt.Fprintln(g.out, ws+" if !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" "+out+" = make("+g.getType(t)+", 0, "+fmt.Sprint(capacity)+")") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" "+out+" = "+g.getType(t)+"{}") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" } else { ") - fmt.Fprintln(g.out, ws+" "+out+" = ("+out+")[:0]") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" for !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" var "+tmpVar+" "+g.getType(elem)) - - if err := g.genTypeDecoder(elem, tmpVar, tags, indent+2); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" "+out+" = append("+out+", "+tmpVar+")") - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Array: - iterVar := g.uniqueVarName() - elem := t.Elem() - - if elem.Kind() == reflect.Uint8 { - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" copy("+out+"[:], in.Bytes())") - fmt.Fprintln(g.out, ws+"}") - - } else { - - length := t.Len() - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('[')") - fmt.Fprintln(g.out, ws+" "+iterVar+" := 0") - fmt.Fprintln(g.out, ws+" for !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" if "+iterVar+" < "+fmt.Sprint(length)+" {") - - if err := g.genTypeDecoder(elem, out+"["+iterVar+"]", tags, indent+3); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" "+iterVar+"++") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" in.SkipRecursive()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Struct: - dec := g.getDecoderName(t) - g.addType(t) - - fmt.Fprintln(g.out, ws+dec+"(in, &"+out+")") - - case reflect.Ptr: - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" if "+out+" == nil {") - fmt.Fprintln(g.out, ws+" "+out+" = new("+g.getType(t.Elem())+")") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeDecoder(t.Elem(), "*"+out, tags, indent+1); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+"}") - - case reflect.Map: - key := t.Key() - keyDec, ok := primitiveStringDecoders[key.Kind()] - if !ok { - return fmt.Errorf("map type %v not supported: only string and integer keys are allowed", key) - } - elem := t.Elem() - tmpVar := g.uniqueVarName() - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('{')") - fmt.Fprintln(g.out, ws+" if !in.IsDelim('}') {") - fmt.Fprintln(g.out, ws+" "+out+" = make("+g.getType(t)+")") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+" }") - - fmt.Fprintln(g.out, ws+" for !in.IsDelim('}') {") - fmt.Fprintln(g.out, ws+" key := "+g.getType(key)+"("+keyDec+")") - fmt.Fprintln(g.out, ws+" in.WantColon()") - fmt.Fprintln(g.out, ws+" var "+tmpVar+" "+g.getType(elem)) - - if err := g.genTypeDecoder(elem, tmpVar, tags, indent+2); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" ("+out+")[key] = "+tmpVar) - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim('}')") - fmt.Fprintln(g.out, ws+"}") - - case reflect.Interface: - if t.NumMethod() != 0 { - return fmt.Errorf("interface type %v not supported: only interface{} is allowed", t) - } - fmt.Fprintln(g.out, ws+"if m, ok := "+out+".(easyjson.Unmarshaler); ok {") - fmt.Fprintln(g.out, ws+"m.UnmarshalEasyJSON(in)") - fmt.Fprintln(g.out, ws+"} else if m, ok := "+out+".(json.Unmarshaler); ok {") - fmt.Fprintln(g.out, ws+"_ = m.UnmarshalJSON(in.Raw())") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" "+out+" = in.Interface()") - fmt.Fprintln(g.out, ws+"}") - default: - return fmt.Errorf("don't know how to decode %v", t) - } - return nil - -} - -func (g *Generator) genStructFieldDecoder(t reflect.Type, f reflect.StructField) error { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if tags.omit { - return nil - } - - fmt.Fprintf(g.out, " case %q:\n", jsonName) - if err := g.genTypeDecoder(f.Type, "out."+f.Name, tags, 3); err != nil { - return err - } - - if tags.required { - fmt.Fprintf(g.out, "%sSet = true\n", f.Name) - } - - return nil -} - -func (g *Generator) genRequiredFieldSet(t reflect.Type, f reflect.StructField) { - tags := parseFieldTags(f) - - if !tags.required { - return - } - - fmt.Fprintf(g.out, "var %sSet bool\n", f.Name) -} - -func (g *Generator) genRequiredFieldCheck(t reflect.Type, f reflect.StructField) { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if !tags.required { - return - } - - g.imports["fmt"] = "fmt" - - fmt.Fprintf(g.out, "if !%sSet {\n", f.Name) - fmt.Fprintf(g.out, " in.AddError(fmt.Errorf(\"key '%s' is required\"))\n", jsonName) - fmt.Fprintf(g.out, "}\n") -} - -func mergeStructFields(fields1, fields2 []reflect.StructField) (fields []reflect.StructField) { - used := map[string]bool{} - for _, f := range fields2 { - used[f.Name] = true - fields = append(fields, f) - } - - for _, f := range fields1 { - if !used[f.Name] { - fields = append(fields, f) - } - } - return -} - -func getStructFields(t reflect.Type) ([]reflect.StructField, error) { - if t.Kind() != reflect.Struct { - return nil, fmt.Errorf("got %v; expected a struct", t) - } - - var efields []reflect.StructField - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if !f.Anonymous { - continue - } - - t1 := f.Type - if t1.Kind() == reflect.Ptr { - t1 = t1.Elem() - } - - fs, err := getStructFields(t1) - if err != nil { - return nil, fmt.Errorf("error processing embedded field: %v", err) - } - efields = mergeStructFields(efields, fs) - } - - var fields []reflect.StructField - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if f.Anonymous { - continue - } - - c := []rune(f.Name)[0] - if unicode.IsUpper(c) { - fields = append(fields, f) - } - } - return mergeStructFields(efields, fields), nil -} - -func (g *Generator) genDecoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - return g.genSliceArrayDecoder(t) - default: - return g.genStructDecoder(t) - } -} - -func (g *Generator) genSliceArrayDecoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a slice/array/map type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(in *jlexer.Lexer, out *"+typ+") {") - fmt.Fprintln(g.out, " isTopLevel := in.IsStart()") - err := g.genTypeDecoderNoCheck(t, "*out", fieldTags{}, 1) - if err != nil { - return err - } - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructDecoder(t reflect.Type) error { - if t.Kind() != reflect.Struct { - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(in *jlexer.Lexer, out *"+typ+") {") - fmt.Fprintln(g.out, " isTopLevel := in.IsStart()") - fmt.Fprintln(g.out, " if in.IsNull() {") - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.Skip()") - fmt.Fprintln(g.out, " return") - fmt.Fprintln(g.out, " }") - - // Init embedded pointer fields. - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if !f.Anonymous || f.Type.Kind() != reflect.Ptr { - continue - } - fmt.Fprintln(g.out, " out."+f.Name+" = new("+g.getType(f.Type.Elem())+")") - } - - fs, err := getStructFields(t) - if err != nil { - return fmt.Errorf("cannot generate decoder for %v: %v", t, err) - } - - for _, f := range fs { - g.genRequiredFieldSet(t, f) - } - - fmt.Fprintln(g.out, " in.Delim('{')") - fmt.Fprintln(g.out, " for !in.IsDelim('}') {") - fmt.Fprintln(g.out, " key := in.UnsafeString()") - fmt.Fprintln(g.out, " in.WantColon()") - fmt.Fprintln(g.out, " if in.IsNull() {") - fmt.Fprintln(g.out, " in.Skip()") - fmt.Fprintln(g.out, " in.WantComma()") - fmt.Fprintln(g.out, " continue") - fmt.Fprintln(g.out, " }") - - fmt.Fprintln(g.out, " switch key {") - for _, f := range fs { - if err := g.genStructFieldDecoder(t, f); err != nil { - return err - } - } - - fmt.Fprintln(g.out, " default:") - fmt.Fprintln(g.out, " in.SkipRecursive()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.WantComma()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.Delim('}')") - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - - for _, f := range fs { - g.genRequiredFieldCheck(t, f) - } - - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructUnmarshaler(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map, reflect.Struct: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct/slice/array/map type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - if !g.noStdMarshalers { - fmt.Fprintln(g.out, "// UnmarshalJSON supports json.Unmarshaler interface") - fmt.Fprintln(g.out, "func (v *"+typ+") UnmarshalJSON(data []byte) error {") - fmt.Fprintln(g.out, " r := jlexer.Lexer{Data: data}") - fmt.Fprintln(g.out, " "+fname+"(&r, v)") - fmt.Fprintln(g.out, " return r.Error()") - fmt.Fprintln(g.out, "}") - } - - fmt.Fprintln(g.out, "// UnmarshalEasyJSON supports easyjson.Unmarshaler interface") - fmt.Fprintln(g.out, "func (v *"+typ+") UnmarshalEasyJSON(l *jlexer.Lexer) {") - fmt.Fprintln(g.out, " "+fname+"(l, v)") - fmt.Fprintln(g.out, "}") - - return nil -} diff --git a/cmd/vendor/github.com/mailru/easyjson/gen/encoder.go b/cmd/vendor/github.com/mailru/easyjson/gen/encoder.go deleted file mode 100644 index 48cba15d4c..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/gen/encoder.go +++ /dev/null @@ -1,382 +0,0 @@ -package gen - -import ( - "encoding" - "encoding/json" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/mailru/easyjson" -) - -func (g *Generator) getEncoderName(t reflect.Type) string { - return g.functionName("encode", t) -} - -var primitiveEncoders = map[reflect.Kind]string{ - reflect.String: "out.String(string(%v))", - reflect.Bool: "out.Bool(bool(%v))", - reflect.Int: "out.Int(int(%v))", - reflect.Int8: "out.Int8(int8(%v))", - reflect.Int16: "out.Int16(int16(%v))", - reflect.Int32: "out.Int32(int32(%v))", - reflect.Int64: "out.Int64(int64(%v))", - reflect.Uint: "out.Uint(uint(%v))", - reflect.Uint8: "out.Uint8(uint8(%v))", - reflect.Uint16: "out.Uint16(uint16(%v))", - reflect.Uint32: "out.Uint32(uint32(%v))", - reflect.Uint64: "out.Uint64(uint64(%v))", - reflect.Float32: "out.Float32(float32(%v))", - reflect.Float64: "out.Float64(float64(%v))", -} - -var primitiveStringEncoders = map[reflect.Kind]string{ - reflect.String: "out.String(string(%v))", - reflect.Int: "out.IntStr(int(%v))", - reflect.Int8: "out.Int8Str(int8(%v))", - reflect.Int16: "out.Int16Str(int16(%v))", - reflect.Int32: "out.Int32Str(int32(%v))", - reflect.Int64: "out.Int64Str(int64(%v))", - reflect.Uint: "out.UintStr(uint(%v))", - reflect.Uint8: "out.Uint8Str(uint8(%v))", - reflect.Uint16: "out.Uint16Str(uint16(%v))", - reflect.Uint32: "out.Uint32Str(uint32(%v))", - reflect.Uint64: "out.Uint64Str(uint64(%v))", - reflect.Uintptr: "out.UintptrStr(uintptr(%v))", -} - -// fieldTags contains parsed version of json struct field tags. -type fieldTags struct { - name string - - omit bool - omitEmpty bool - noOmitEmpty bool - asString bool - required bool -} - -// parseFieldTags parses the json field tag into a structure. -func parseFieldTags(f reflect.StructField) fieldTags { - var ret fieldTags - - for i, s := range strings.Split(f.Tag.Get("json"), ",") { - switch { - case i == 0 && s == "-": - ret.omit = true - case i == 0: - ret.name = s - case s == "omitempty": - ret.omitEmpty = true - case s == "!omitempty": - ret.noOmitEmpty = true - case s == "string": - ret.asString = true - case s == "required": - ret.required = true - } - } - - return ret -} - -// genTypeEncoder generates code that encodes in of type t into the writer, but uses marshaler interface if implemented by t. -func (g *Generator) genTypeEncoder(t reflect.Type, in string, tags fieldTags, indent int, assumeNonEmpty bool) error { - ws := strings.Repeat(" ", indent) - - marshalerIface := reflect.TypeOf((*easyjson.Marshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"("+in+").MarshalEasyJSON(out)") - return nil - } - - marshalerIface = reflect.TypeOf((*json.Marshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"out.Raw( ("+in+").MarshalJSON() )") - return nil - } - - marshalerIface = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"out.RawText( ("+in+").MarshalText() )") - return nil - } - - err := g.genTypeEncoderNoCheck(t, in, tags, indent, assumeNonEmpty) - return err -} - -// genTypeEncoderNoCheck generates code that encodes in of type t into the writer. -func (g *Generator) genTypeEncoderNoCheck(t reflect.Type, in string, tags fieldTags, indent int, assumeNonEmpty bool) error { - ws := strings.Repeat(" ", indent) - - // Check whether type is primitive, needs to be done after interface check. - if enc := primitiveStringEncoders[t.Kind()]; enc != "" && tags.asString { - fmt.Fprintf(g.out, ws+enc+"\n", in) - return nil - } else if enc := primitiveEncoders[t.Kind()]; enc != "" { - fmt.Fprintf(g.out, ws+enc+"\n", in) - return nil - } - - switch t.Kind() { - case reflect.Slice: - elem := t.Elem() - iVar := g.uniqueVarName() - vVar := g.uniqueVarName() - - if t.Elem().Kind() == reflect.Uint8 { - fmt.Fprintln(g.out, ws+"out.Base64Bytes("+in+")") - } else { - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil && (out.Flags & jwriter.NilSliceAsEmpty) == 0 {") - fmt.Fprintln(g.out, ws+` out.RawString("null")`) - fmt.Fprintln(g.out, ws+"} else {") - } else { - fmt.Fprintln(g.out, ws+"{") - } - fmt.Fprintln(g.out, ws+" out.RawByte('[')") - fmt.Fprintln(g.out, ws+" for "+iVar+", "+vVar+" := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+iVar+" > 0 {") - fmt.Fprintln(g.out, ws+" out.RawByte(',')") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeEncoder(elem, vVar, tags, indent+2, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" out.RawByte(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Array: - elem := t.Elem() - iVar := g.uniqueVarName() - - if t.Elem().Kind() == reflect.Uint8 { - fmt.Fprintln(g.out, ws+"out.Base64Bytes("+in+"[:])") - } else { - fmt.Fprintln(g.out, ws+"out.RawByte('[')") - fmt.Fprintln(g.out, ws+"for "+iVar+" := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+iVar+" > 0 {") - fmt.Fprintln(g.out, ws+" out.RawByte(',')") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeEncoder(elem, in+"["+iVar+"]", tags, indent+1, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+"}") - fmt.Fprintln(g.out, ws+"out.RawByte(']')") - } - - case reflect.Struct: - enc := g.getEncoderName(t) - g.addType(t) - - fmt.Fprintln(g.out, ws+enc+"(out, "+in+")") - - case reflect.Ptr: - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil {") - fmt.Fprintln(g.out, ws+` out.RawString("null")`) - fmt.Fprintln(g.out, ws+"} else {") - } - - if err := g.genTypeEncoder(t.Elem(), "*"+in, tags, indent+1, false); err != nil { - return err - } - - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Map: - key := t.Key() - keyEnc, ok := primitiveStringEncoders[key.Kind()] - if !ok { - return fmt.Errorf("map key type %v not supported: only string and integer keys are allowed", key) - } - tmpVar := g.uniqueVarName() - - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil && (out.Flags & jwriter.NilMapAsEmpty) == 0 {") - fmt.Fprintln(g.out, ws+" out.RawString(`null`)") - fmt.Fprintln(g.out, ws+"} else {") - } else { - fmt.Fprintln(g.out, ws+"{") - } - fmt.Fprintln(g.out, ws+" out.RawByte('{')") - fmt.Fprintln(g.out, ws+" "+tmpVar+"First := true") - fmt.Fprintln(g.out, ws+" for "+tmpVar+"Name, "+tmpVar+"Value := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+tmpVar+"First { "+tmpVar+"First = false } else { out.RawByte(',') }") - fmt.Fprintln(g.out, ws+" "+fmt.Sprintf(keyEnc, tmpVar+"Name")) - fmt.Fprintln(g.out, ws+" out.RawByte(':')") - - if err := g.genTypeEncoder(t.Elem(), tmpVar+"Value", tags, indent+2, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" out.RawByte('}')") - fmt.Fprintln(g.out, ws+"}") - - case reflect.Interface: - if t.NumMethod() != 0 { - return fmt.Errorf("interface type %v not supported: only interface{} is allowed", t) - } - fmt.Fprintln(g.out, ws+"if m, ok := "+in+".(easyjson.Marshaler); ok {") - fmt.Fprintln(g.out, ws+" m.MarshalEasyJSON(out)") - fmt.Fprintln(g.out, ws+"} else if m, ok := "+in+".(json.Marshaler); ok {") - fmt.Fprintln(g.out, ws+" out.Raw(m.MarshalJSON())") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" out.Raw(json.Marshal("+in+"))") - fmt.Fprintln(g.out, ws+"}") - - default: - return fmt.Errorf("don't know how to encode %v", t) - } - return nil -} - -func (g *Generator) notEmptyCheck(t reflect.Type, v string) string { - optionalIface := reflect.TypeOf((*easyjson.Optional)(nil)).Elem() - if reflect.PtrTo(t).Implements(optionalIface) { - return "(" + v + ").IsDefined()" - } - - switch t.Kind() { - case reflect.Slice, reflect.Map: - return "len(" + v + ") != 0" - case reflect.Interface, reflect.Ptr: - return v + " != nil" - case reflect.Bool: - return v - case reflect.String: - return v + ` != ""` - case reflect.Float32, reflect.Float64, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - - return v + " != 0" - - default: - // note: Array types don't have a useful empty value - return "true" - } -} - -func (g *Generator) genStructFieldEncoder(t reflect.Type, f reflect.StructField) error { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if tags.omit { - return nil - } - noOmitEmpty := (!tags.omitEmpty && !g.omitEmpty) || tags.noOmitEmpty - if noOmitEmpty { - fmt.Fprintln(g.out, " {") - } else { - fmt.Fprintln(g.out, " if", g.notEmptyCheck(f.Type, "in."+f.Name), "{") - } - fmt.Fprintf(g.out, " const prefix string = %q\n", ","+strconv.Quote(jsonName)+":") - fmt.Fprintln(g.out, " if first {") - fmt.Fprintln(g.out, " first = false") - fmt.Fprintln(g.out, " out.RawString(prefix[1:])") - fmt.Fprintln(g.out, " } else {") - fmt.Fprintln(g.out, " out.RawString(prefix)") - fmt.Fprintln(g.out, " }") - - if err := g.genTypeEncoder(f.Type, "in."+f.Name, tags, 2, !noOmitEmpty); err != nil { - return err - } - fmt.Fprintln(g.out, " }") - return nil -} - -func (g *Generator) genEncoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - return g.genSliceArrayMapEncoder(t) - default: - return g.genStructEncoder(t) - } -} - -func (g *Generator) genSliceArrayMapEncoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a slice/array/map type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(out *jwriter.Writer, in "+typ+") {") - err := g.genTypeEncoderNoCheck(t, "in", fieldTags{}, 1, false) - if err != nil { - return err - } - fmt.Fprintln(g.out, "}") - return nil -} - -func (g *Generator) genStructEncoder(t reflect.Type) error { - if t.Kind() != reflect.Struct { - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(out *jwriter.Writer, in "+typ+") {") - fmt.Fprintln(g.out, " out.RawByte('{')") - fmt.Fprintln(g.out, " first := true") - fmt.Fprintln(g.out, " _ = first") - - fs, err := getStructFields(t) - if err != nil { - return fmt.Errorf("cannot generate encoder for %v: %v", t, err) - } - for _, f := range fs { - if err := g.genStructFieldEncoder(t, f); err != nil { - return err - } - } - - fmt.Fprintln(g.out, " out.RawByte('}')") - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructMarshaler(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map, reflect.Struct: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct/slice/array/map type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - if !g.noStdMarshalers { - fmt.Fprintln(g.out, "// MarshalJSON supports json.Marshaler interface") - fmt.Fprintln(g.out, "func (v "+typ+") MarshalJSON() ([]byte, error) {") - fmt.Fprintln(g.out, " w := jwriter.Writer{}") - fmt.Fprintln(g.out, " "+fname+"(&w, v)") - fmt.Fprintln(g.out, " return w.Buffer.BuildBytes(), w.Error") - fmt.Fprintln(g.out, "}") - } - - fmt.Fprintln(g.out, "// MarshalEasyJSON supports easyjson.Marshaler interface") - fmt.Fprintln(g.out, "func (v "+typ+") MarshalEasyJSON(w *jwriter.Writer) {") - fmt.Fprintln(g.out, " "+fname+"(w, v)") - fmt.Fprintln(g.out, "}") - - return nil -} diff --git a/cmd/vendor/github.com/mailru/easyjson/gen/generator.go b/cmd/vendor/github.com/mailru/easyjson/gen/generator.go deleted file mode 100644 index eb0d70ba27..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/gen/generator.go +++ /dev/null @@ -1,523 +0,0 @@ -package gen - -import ( - "bytes" - "fmt" - "hash/fnv" - "io" - "path" - "reflect" - "sort" - "strconv" - "strings" - "unicode" -) - -const pkgWriter = "github.com/mailru/easyjson/jwriter" -const pkgLexer = "github.com/mailru/easyjson/jlexer" -const pkgEasyJSON = "github.com/mailru/easyjson" - -// FieldNamer defines a policy for generating names for struct fields. -type FieldNamer interface { - GetJSONFieldName(t reflect.Type, f reflect.StructField) string -} - -// Generator generates the requested marshaler/unmarshalers. -type Generator struct { - out *bytes.Buffer - - pkgName string - pkgPath string - buildTags string - hashString string - - varCounter int - - noStdMarshalers bool - omitEmpty bool - fieldNamer FieldNamer - - // package path to local alias map for tracking imports - imports map[string]string - - // types that marshalers were requested for by user - marshalers map[reflect.Type]bool - - // types that encoders were already generated for - typesSeen map[reflect.Type]bool - - // types that encoders were requested for (e.g. by encoders of other types) - typesUnseen []reflect.Type - - // function name to relevant type maps to track names of de-/encoders in - // case of a name clash or unnamed structs - functionNames map[string]reflect.Type -} - -// NewGenerator initializes and returns a Generator. -func NewGenerator(filename string) *Generator { - ret := &Generator{ - imports: map[string]string{ - pkgWriter: "jwriter", - pkgLexer: "jlexer", - pkgEasyJSON: "easyjson", - "encoding/json": "json", - }, - fieldNamer: DefaultFieldNamer{}, - marshalers: make(map[reflect.Type]bool), - typesSeen: make(map[reflect.Type]bool), - functionNames: make(map[string]reflect.Type), - } - - // Use a file-unique prefix on all auxiliary funcs to avoid - // name clashes. - hash := fnv.New32() - hash.Write([]byte(filename)) - ret.hashString = fmt.Sprintf("%x", hash.Sum32()) - - return ret -} - -// SetPkg sets the name and path of output package. -func (g *Generator) SetPkg(name, path string) { - g.pkgName = name - g.pkgPath = path -} - -// SetBuildTags sets build tags for the output file. -func (g *Generator) SetBuildTags(tags string) { - g.buildTags = tags -} - -// SetFieldNamer sets field naming strategy. -func (g *Generator) SetFieldNamer(n FieldNamer) { - g.fieldNamer = n -} - -// UseSnakeCase sets snake_case field naming strategy. -func (g *Generator) UseSnakeCase() { - g.fieldNamer = SnakeCaseFieldNamer{} -} - -// UseLowerCamelCase sets lowerCamelCase field naming strategy. -func (g *Generator) UseLowerCamelCase() { - g.fieldNamer = LowerCamelCaseFieldNamer{} -} - -// NoStdMarshalers instructs not to generate standard MarshalJSON/UnmarshalJSON -// methods (only the custom interface). -func (g *Generator) NoStdMarshalers() { - g.noStdMarshalers = true -} - -// OmitEmpty triggers `json=",omitempty"` behaviour by default. -func (g *Generator) OmitEmpty() { - g.omitEmpty = true -} - -// addTypes requests to generate encoding/decoding funcs for the given type. -func (g *Generator) addType(t reflect.Type) { - if g.typesSeen[t] { - return - } - for _, t1 := range g.typesUnseen { - if t1 == t { - return - } - } - g.typesUnseen = append(g.typesUnseen, t) -} - -// Add requests to generate marshaler/unmarshalers and encoding/decoding -// funcs for the type of given object. -func (g *Generator) Add(obj interface{}) { - t := reflect.TypeOf(obj) - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - g.addType(t) - g.marshalers[t] = true -} - -// printHeader prints package declaration and imports. -func (g *Generator) printHeader() { - if g.buildTags != "" { - fmt.Println("// +build ", g.buildTags) - fmt.Println() - } - fmt.Println("// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.") - fmt.Println() - fmt.Println("package ", g.pkgName) - fmt.Println() - - byAlias := map[string]string{} - var aliases []string - for path, alias := range g.imports { - aliases = append(aliases, alias) - byAlias[alias] = path - } - - sort.Strings(aliases) - fmt.Println("import (") - for _, alias := range aliases { - fmt.Printf(" %s %q\n", alias, byAlias[alias]) - } - - fmt.Println(")") - fmt.Println("") - fmt.Println("// suppress unused package warning") - fmt.Println("var (") - fmt.Println(" _ *json.RawMessage") - fmt.Println(" _ *jlexer.Lexer") - fmt.Println(" _ *jwriter.Writer") - fmt.Println(" _ easyjson.Marshaler") - fmt.Println(")") - - fmt.Println() -} - -// Run runs the generator and outputs generated code to out. -func (g *Generator) Run(out io.Writer) error { - g.out = &bytes.Buffer{} - - for len(g.typesUnseen) > 0 { - t := g.typesUnseen[len(g.typesUnseen)-1] - g.typesUnseen = g.typesUnseen[:len(g.typesUnseen)-1] - g.typesSeen[t] = true - - if err := g.genDecoder(t); err != nil { - return err - } - if err := g.genEncoder(t); err != nil { - return err - } - - if !g.marshalers[t] { - continue - } - - if err := g.genStructMarshaler(t); err != nil { - return err - } - if err := g.genStructUnmarshaler(t); err != nil { - return err - } - } - g.printHeader() - _, err := out.Write(g.out.Bytes()) - return err -} - -// fixes vendored paths -func fixPkgPathVendoring(pkgPath string) string { - const vendor = "/vendor/" - if i := strings.LastIndex(pkgPath, vendor); i != -1 { - return pkgPath[i+len(vendor):] - } - return pkgPath -} - -func fixAliasName(alias string) string { - alias = strings.Replace( - strings.Replace(alias, ".", "_", -1), - "-", - "_", - -1, - ) - - if alias[0] == 'v' { // to void conflicting with var names, say v1 - alias = "_" + alias - } - return alias -} - -// pkgAlias creates and returns and import alias for a given package. -func (g *Generator) pkgAlias(pkgPath string) string { - pkgPath = fixPkgPathVendoring(pkgPath) - if alias := g.imports[pkgPath]; alias != "" { - return alias - } - - for i := 0; ; i++ { - alias := fixAliasName(path.Base(pkgPath)) - if i > 0 { - alias += fmt.Sprint(i) - } - - exists := false - for _, v := range g.imports { - if v == alias { - exists = true - break - } - } - - if !exists { - g.imports[pkgPath] = alias - return alias - } - } -} - -// getType return the textual type name of given type that can be used in generated code. -func (g *Generator) getType(t reflect.Type) string { - if t.Name() == "" { - switch t.Kind() { - case reflect.Ptr: - return "*" + g.getType(t.Elem()) - case reflect.Slice: - return "[]" + g.getType(t.Elem()) - case reflect.Array: - return "[" + strconv.Itoa(t.Len()) + "]" + g.getType(t.Elem()) - case reflect.Map: - return "map[" + g.getType(t.Key()) + "]" + g.getType(t.Elem()) - } - } - - if t.Name() == "" || t.PkgPath() == "" { - if t.Kind() == reflect.Struct { - // the fields of an anonymous struct can have named types, - // and t.String() will not be sufficient because it does not - // remove the package name when it matches g.pkgPath. - // so we convert by hand - nf := t.NumField() - lines := make([]string, 0, nf) - for i := 0; i < nf; i++ { - f := t.Field(i) - line := f.Name + " " + g.getType(f.Type) - t := f.Tag - if t != "" { - line += " " + escapeTag(t) - } - lines = append(lines, line) - } - return strings.Join([]string{"struct { ", strings.Join(lines, "; "), " }"}, "") - } - return t.String() - } else if t.PkgPath() == g.pkgPath { - return t.Name() - } - return g.pkgAlias(t.PkgPath()) + "." + t.Name() -} - -// escape a struct field tag string back to source code -func escapeTag(tag reflect.StructTag) string { - t := string(tag) - if strings.ContainsRune(t, '`') { - // there are ` in the string; we can't use ` to enclose the string - return strconv.Quote(t) - } - return "`" + t + "`" -} - -// uniqueVarName returns a file-unique name that can be used for generated variables. -func (g *Generator) uniqueVarName() string { - g.varCounter++ - return fmt.Sprint("v", g.varCounter) -} - -// safeName escapes unsafe characters in pkg/type name and returns a string that can be used -// in encoder/decoder names for the type. -func (g *Generator) safeName(t reflect.Type) string { - name := t.PkgPath() - if t.Name() == "" { - name += "anonymous" - } else { - name += "." + t.Name() - } - - parts := []string{} - part := []rune{} - for _, c := range name { - if unicode.IsLetter(c) || unicode.IsDigit(c) { - part = append(part, c) - } else if len(part) > 0 { - parts = append(parts, string(part)) - part = []rune{} - } - } - return joinFunctionNameParts(false, parts...) -} - -// functionName returns a function name for a given type with a given prefix. If a function -// with this prefix already exists for a type, it is returned. -// -// Method is used to track encoder/decoder names for the type. -func (g *Generator) functionName(prefix string, t reflect.Type) string { - prefix = joinFunctionNameParts(true, "easyjson", g.hashString, prefix) - name := joinFunctionNameParts(true, prefix, g.safeName(t)) - - // Most of the names will be unique, try a shortcut first. - if e, ok := g.functionNames[name]; !ok || e == t { - g.functionNames[name] = t - return name - } - - // Search if the function already exists. - for name1, t1 := range g.functionNames { - if t1 == t && strings.HasPrefix(name1, prefix) { - return name1 - } - } - - // Create a new name in the case of a clash. - for i := 1; ; i++ { - nm := fmt.Sprint(name, i) - if _, ok := g.functionNames[nm]; ok { - continue - } - g.functionNames[nm] = t - return nm - } -} - -// DefaultFieldsNamer implements trivial naming policy equivalent to encoding/json. -type DefaultFieldNamer struct{} - -func (DefaultFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } else { - return f.Name - } -} - -// LowerCamelCaseFieldNamer -type LowerCamelCaseFieldNamer struct{} - -func isLower(b byte) bool { - return b <= 122 && b >= 97 -} - -func isUpper(b byte) bool { - return b >= 65 && b <= 90 -} - -// convert HTTPRestClient to httpRestClient -func lowerFirst(s string) string { - if s == "" { - return "" - } - - str := "" - strlen := len(s) - - /** - Loop each char - If is uppercase: - If is first char, LOWER it - If the following char is lower, LEAVE it - If the following char is upper OR numeric, LOWER it - If is the end of string, LEAVE it - Else lowercase - */ - - foundLower := false - for i := range s { - ch := s[i] - if isUpper(ch) { - if i == 0 { - str += string(ch + 32) - } else if !foundLower { // Currently just a stream of capitals, eg JSONRESTS[erver] - if strlen > (i+1) && isLower(s[i+1]) { - // Next char is lower, keep this a capital - str += string(ch) - } else { - // Either at end of string or next char is capital - str += string(ch + 32) - } - } else { - str += string(ch) - } - } else { - foundLower = true - str += string(ch) - } - } - - return str -} - -func (LowerCamelCaseFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } else { - return lowerFirst(f.Name) - } -} - -// SnakeCaseFieldNamer implements CamelCase to snake_case conversion for fields names. -type SnakeCaseFieldNamer struct{} - -func camelToSnake(name string) string { - var ret bytes.Buffer - - multipleUpper := false - var lastUpper rune - var beforeUpper rune - - for _, c := range name { - // Non-lowercase character after uppercase is considered to be uppercase too. - isUpper := (unicode.IsUpper(c) || (lastUpper != 0 && !unicode.IsLower(c))) - - if lastUpper != 0 { - // Output a delimiter if last character was either the first uppercase character - // in a row, or the last one in a row (e.g. 'S' in "HTTPServer"). - // Do not output a delimiter at the beginning of the name. - - firstInRow := !multipleUpper - lastInRow := !isUpper - - if ret.Len() > 0 && (firstInRow || lastInRow) && beforeUpper != '_' { - ret.WriteByte('_') - } - ret.WriteRune(unicode.ToLower(lastUpper)) - } - - // Buffer uppercase char, do not output it yet as a delimiter may be required if the - // next character is lowercase. - if isUpper { - multipleUpper = (lastUpper != 0) - lastUpper = c - continue - } - - ret.WriteRune(c) - lastUpper = 0 - beforeUpper = c - multipleUpper = false - } - - if lastUpper != 0 { - ret.WriteRune(unicode.ToLower(lastUpper)) - } - return string(ret.Bytes()) -} - -func (SnakeCaseFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } - - return camelToSnake(f.Name) -} - -func joinFunctionNameParts(keepFirst bool, parts ...string) string { - buf := bytes.NewBufferString("") - for i, part := range parts { - if i == 0 && keepFirst { - buf.WriteString(part) - } else { - if len(part) > 0 { - buf.WriteString(strings.ToUpper(string(part[0]))) - } - if len(part) > 1 { - buf.WriteString(part[1:]) - } - } - } - return buf.String() -} diff --git a/cmd/vendor/github.com/mailru/easyjson/helpers.go b/cmd/vendor/github.com/mailru/easyjson/helpers.go deleted file mode 100644 index b86b87d228..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/helpers.go +++ /dev/null @@ -1,78 +0,0 @@ -// Package easyjson contains marshaler/unmarshaler interfaces and helper functions. -package easyjson - -import ( - "io" - "io/ioutil" - "net/http" - "strconv" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// Marshaler is an easyjson-compatible marshaler interface. -type Marshaler interface { - MarshalEasyJSON(w *jwriter.Writer) -} - -// Marshaler is an easyjson-compatible unmarshaler interface. -type Unmarshaler interface { - UnmarshalEasyJSON(w *jlexer.Lexer) -} - -// Optional defines an undefined-test method for a type to integrate with 'omitempty' logic. -type Optional interface { - IsDefined() bool -} - -// Marshal returns data as a single byte slice. Method is suboptimal as the data is likely to be copied -// from a chain of smaller chunks. -func Marshal(v Marshaler) ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.BuildBytes() -} - -// MarshalToWriter marshals the data to an io.Writer. -func MarshalToWriter(v Marshaler, w io.Writer) (written int, err error) { - jw := jwriter.Writer{} - v.MarshalEasyJSON(&jw) - return jw.DumpTo(w) -} - -// MarshalToHTTPResponseWriter sets Content-Length and Content-Type headers for the -// http.ResponseWriter, and send the data to the writer. started will be equal to -// false if an error occurred before any http.ResponseWriter methods were actually -// invoked (in this case a 500 reply is possible). -func MarshalToHTTPResponseWriter(v Marshaler, w http.ResponseWriter) (started bool, written int, err error) { - jw := jwriter.Writer{} - v.MarshalEasyJSON(&jw) - if jw.Error != nil { - return false, 0, jw.Error - } - w.Header().Set("Content-Type", "application/json") - w.Header().Set("Content-Length", strconv.Itoa(jw.Size())) - - started = true - written, err = jw.DumpTo(w) - return -} - -// Unmarshal decodes the JSON in data into the object. -func Unmarshal(data []byte, v Unmarshaler) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalFromReader reads all the data in the reader and decodes as JSON into the object. -func UnmarshalFromReader(r io.Reader, v Unmarshaler) error { - data, err := ioutil.ReadAll(r) - if err != nil { - return err - } - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} diff --git a/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go deleted file mode 100644 index ff7b27c5b2..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go +++ /dev/null @@ -1,24 +0,0 @@ -// This file will only be included to the build if neither -// easyjson_nounsafe nor appengine build tag is set. See README notes -// for more details. - -//+build !easyjson_nounsafe -//+build !appengine - -package jlexer - -import ( - "reflect" - "unsafe" -) - -// bytesToStr creates a string pointing at the slice to avoid copying. -// -// Warning: the string returned by the function should be used with care, as the whole input data -// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data -// may be garbage-collected even when the string exists. -func bytesToStr(data []byte) string { - h := (*reflect.SliceHeader)(unsafe.Pointer(&data)) - shdr := reflect.StringHeader{Data: h.Data, Len: h.Len} - return *(*string)(unsafe.Pointer(&shdr)) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go b/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go deleted file mode 100644 index 864d1be676..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go +++ /dev/null @@ -1,13 +0,0 @@ -// This file is included to the build if any of the buildtags below -// are defined. Refer to README notes for more details. - -//+build easyjson_nounsafe appengine - -package jlexer - -// bytesToStr creates a string normally from []byte -// -// Note that this method is roughly 1.5x slower than using the 'unsafe' method. -func bytesToStr(data []byte) string { - return string(data) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/jlexer/error.go b/cmd/vendor/github.com/mailru/easyjson/jlexer/error.go deleted file mode 100644 index e90ec40d05..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/jlexer/error.go +++ /dev/null @@ -1,15 +0,0 @@ -package jlexer - -import "fmt" - -// LexerError implements the error interface and represents all possible errors that can be -// generated during parsing the JSON data. -type LexerError struct { - Reason string - Offset int - Data string -} - -func (l *LexerError) Error() string { - return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/cmd/vendor/github.com/mailru/easyjson/jlexer/lexer.go deleted file mode 100644 index e5558ae39c..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ /dev/null @@ -1,1141 +0,0 @@ -// Package jlexer contains a JSON lexer implementation. -// -// It is expected that it is mostly used with generated parser code, so the interface is tuned -// for a parser that knows what kind of data is expected. -package jlexer - -import ( - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "strconv" - "unicode" - "unicode/utf16" - "unicode/utf8" -) - -// tokenKind determines type of a token. -type tokenKind byte - -const ( - tokenUndef tokenKind = iota // No token. - tokenDelim // Delimiter: one of '{', '}', '[' or ']'. - tokenString // A string literal, e.g. "abc\u1234" - tokenNumber // Number literal, e.g. 1.5e5 - tokenBool // Boolean literal: true or false. - tokenNull // null keyword. -) - -// token describes a single token: type, position in the input and value. -type token struct { - kind tokenKind // Type of a token. - - boolValue bool // Value if a boolean literal token. - byteValue []byte // Raw value of a token. - delimValue byte -} - -// Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. -type Lexer struct { - Data []byte // Input data given to the lexer. - - start int // Start of the current token. - pos int // Current unscanned position in the input stream. - token token // Last scanned token, if token.kind != tokenUndef. - - firstElement bool // Whether current element is the first in array or an object. - wantSep byte // A comma or a colon character, which need to occur before a token. - - UseMultipleErrors bool // If we want to use multiple errors. - fatalError error // Fatal error occurred during lexing. It is usually a syntax error. - multipleErrors []*LexerError // Semantic errors occurred during lexing. Marshalling will be continued after finding this errors. -} - -// FetchToken scans the input for the next token. -func (r *Lexer) FetchToken() { - r.token.kind = tokenUndef - r.start = r.pos - - // Check if r.Data has r.pos element - // If it doesn't, it mean corrupted input data - if len(r.Data) < r.pos { - r.errParse("Unexpected end of data") - return - } - // Determine the type of a token by skipping whitespace and reading the - // first character. - for _, c := range r.Data[r.pos:] { - switch c { - case ':', ',': - if r.wantSep == c { - r.pos++ - r.start++ - r.wantSep = 0 - } else { - r.errSyntax() - } - - case ' ', '\t', '\r', '\n': - r.pos++ - r.start++ - - case '"': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenString - r.fetchString() - return - - case '{', '[': - if r.wantSep != 0 { - r.errSyntax() - } - r.firstElement = true - r.token.kind = tokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '}', ']': - if !r.firstElement && (r.wantSep != ',') { - r.errSyntax() - } - r.wantSep = 0 - r.token.kind = tokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-': - if r.wantSep != 0 { - r.errSyntax() - } - r.token.kind = tokenNumber - r.fetchNumber() - return - - case 'n': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenNull - r.fetchNull() - return - - case 't': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenBool - r.token.boolValue = true - r.fetchTrue() - return - - case 'f': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenBool - r.token.boolValue = false - r.fetchFalse() - return - - default: - r.errSyntax() - return - } - } - r.fatalError = io.EOF - return -} - -// isTokenEnd returns true if the char can follow a non-delimiter token -func isTokenEnd(c byte) bool { - return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '[' || c == ']' || c == '{' || c == '}' || c == ',' || c == ':' -} - -// fetchNull fetches and checks remaining bytes of null keyword. -func (r *Lexer) fetchNull() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'u' || - r.Data[r.pos-2] != 'l' || - r.Data[r.pos-1] != 'l' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchTrue fetches and checks remaining bytes of true keyword. -func (r *Lexer) fetchTrue() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'r' || - r.Data[r.pos-2] != 'u' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchFalse fetches and checks remaining bytes of false keyword. -func (r *Lexer) fetchFalse() { - r.pos += 5 - if r.pos > len(r.Data) || - r.Data[r.pos-4] != 'a' || - r.Data[r.pos-3] != 'l' || - r.Data[r.pos-2] != 's' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 5 - r.errSyntax() - } -} - -// fetchNumber scans a number literal token. -func (r *Lexer) fetchNumber() { - hasE := false - afterE := false - hasDot := false - - r.pos++ - for i, c := range r.Data[r.pos:] { - switch { - case c >= '0' && c <= '9': - afterE = false - case c == '.' && !hasDot: - hasDot = true - case (c == 'e' || c == 'E') && !hasE: - hasE = true - hasDot = true - afterE = true - case (c == '+' || c == '-') && afterE: - afterE = false - default: - r.pos += i - if !isTokenEnd(c) { - r.errSyntax() - } else { - r.token.byteValue = r.Data[r.start:r.pos] - } - return - } - } - - r.pos = len(r.Data) - r.token.byteValue = r.Data[r.start:] -} - -// findStringLen tries to scan into the string literal for ending quote char to determine required size. -// The size will be exact if no escapes are present and may be inexact if there are escaped chars. -func findStringLen(data []byte) (hasEscapes bool, length int) { - delta := 0 - - for i := 0; i < len(data); i++ { - switch data[i] { - case '\\': - i++ - delta++ - if i < len(data) && data[i] == 'u' { - delta++ - } - case '"': - return (delta > 0), (i - delta) - } - } - - return false, len(data) -} - -// getu4 decodes \uXXXX from the beginning of s, returning the hex value, -// or it returns -1. -func getu4(s []byte) rune { - if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { - return -1 - } - var val rune - for i := 2; i < len(s) && i < 6; i++ { - var v byte - c := s[i] - switch c { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - v = c - '0' - case 'a', 'b', 'c', 'd', 'e', 'f': - v = c - 'a' + 10 - case 'A', 'B', 'C', 'D', 'E', 'F': - v = c - 'A' + 10 - default: - return -1 - } - - val <<= 4 - val |= rune(v) - } - return val -} - -// processEscape processes a single escape sequence and returns number of bytes processed. -func (r *Lexer) processEscape(data []byte) (int, error) { - if len(data) < 2 { - return 0, fmt.Errorf("syntax error at %v", string(data)) - } - - c := data[1] - switch c { - case '"', '/', '\\': - r.token.byteValue = append(r.token.byteValue, c) - return 2, nil - case 'b': - r.token.byteValue = append(r.token.byteValue, '\b') - return 2, nil - case 'f': - r.token.byteValue = append(r.token.byteValue, '\f') - return 2, nil - case 'n': - r.token.byteValue = append(r.token.byteValue, '\n') - return 2, nil - case 'r': - r.token.byteValue = append(r.token.byteValue, '\r') - return 2, nil - case 't': - r.token.byteValue = append(r.token.byteValue, '\t') - return 2, nil - case 'u': - rr := getu4(data) - if rr < 0 { - return 0, errors.New("syntax error") - } - - read := 6 - if utf16.IsSurrogate(rr) { - rr1 := getu4(data[read:]) - if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { - read += 6 - rr = dec - } else { - rr = unicode.ReplacementChar - } - } - var d [4]byte - s := utf8.EncodeRune(d[:], rr) - r.token.byteValue = append(r.token.byteValue, d[:s]...) - return read, nil - } - - return 0, errors.New("syntax error") -} - -// fetchString scans a string literal token. -func (r *Lexer) fetchString() { - r.pos++ - data := r.Data[r.pos:] - - hasEscapes, length := findStringLen(data) - if !hasEscapes { - r.token.byteValue = data[:length] - r.pos += length + 1 - return - } - - r.token.byteValue = make([]byte, 0, length) - p := 0 - for i := 0; i < len(data); { - switch data[i] { - case '"': - r.pos += i + 1 - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - i++ - return - - case '\\': - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - off, err := r.processEscape(data[i:]) - if err != nil { - r.errParse(err.Error()) - return - } - i += off - p = i - - default: - i++ - } - } - r.errParse("unterminated string literal") -} - -// scanToken scans the next token if no token is currently available in the lexer. -func (r *Lexer) scanToken() { - if r.token.kind != tokenUndef || r.fatalError != nil { - return - } - - r.FetchToken() -} - -// consume resets the current token to allow scanning the next one. -func (r *Lexer) consume() { - r.token.kind = tokenUndef - r.token.delimValue = 0 -} - -// Ok returns true if no error (including io.EOF) was encountered during scanning. -func (r *Lexer) Ok() bool { - return r.fatalError == nil -} - -const maxErrorContextLen = 13 - -func (r *Lexer) errParse(what string) { - if r.fatalError == nil { - var str string - if len(r.Data)-r.pos <= maxErrorContextLen { - str = string(r.Data) - } else { - str = string(r.Data[r.pos:r.pos+maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: what, - Offset: r.pos, - Data: str, - } - } -} - -func (r *Lexer) errSyntax() { - r.errParse("syntax error") -} - -func (r *Lexer) errInvalidToken(expected string) { - if r.fatalError != nil { - return - } - if r.UseMultipleErrors { - r.pos = r.start - r.consume() - r.SkipRecursive() - switch expected { - case "[": - r.token.delimValue = ']' - r.token.kind = tokenDelim - case "{": - r.token.delimValue = '}' - r.token.kind = tokenDelim - } - r.addNonfatalError(&LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - }) - return - } - - var str string - if len(r.token.byteValue) <= maxErrorContextLen { - str = string(r.token.byteValue) - } else { - str = string(r.token.byteValue[:maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.pos, - Data: str, - } -} - -func (r *Lexer) GetPos() int { - return r.pos -} - -// Delim consumes a token and verifies that it is the given delimiter. -func (r *Lexer) Delim(c byte) { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() || r.token.delimValue != c { - r.consume() // errInvalidToken can change token if UseMultipleErrors is enabled. - r.errInvalidToken(string([]byte{c})) - } else { - r.consume() - } -} - -// IsDelim returns true if there was no scanning error and next token is the given delimiter. -func (r *Lexer) IsDelim(c byte) bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - return !r.Ok() || r.token.delimValue == c -} - -// Null verifies that the next token is null and consumes it. -func (r *Lexer) Null() { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenNull { - r.errInvalidToken("null") - } - r.consume() -} - -// IsNull returns true if the next token is a null keyword. -func (r *Lexer) IsNull() bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - return r.Ok() && r.token.kind == tokenNull -} - -// Skip skips a single token. -func (r *Lexer) Skip() { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - r.consume() -} - -// SkipRecursive skips next array or object completely, or just skips a single token if not -// an array/object. -// -// Note: no syntax validation is performed on the skipped data. -func (r *Lexer) SkipRecursive() { - r.scanToken() - var start, end byte - - if r.token.delimValue == '{' { - start, end = '{', '}' - } else if r.token.delimValue == '[' { - start, end = '[', ']' - } else { - r.consume() - return - } - - r.consume() - - level := 1 - inQuotes := false - wasEscape := false - - for i, c := range r.Data[r.pos:] { - switch { - case c == start && !inQuotes: - level++ - case c == end && !inQuotes: - level-- - if level == 0 { - r.pos += i + 1 - return - } - case c == '\\' && inQuotes: - wasEscape = !wasEscape - continue - case c == '"' && inQuotes: - inQuotes = wasEscape - case c == '"': - inQuotes = true - } - wasEscape = false - } - r.pos = len(r.Data) - r.fatalError = &LexerError{ - Reason: "EOF reached while skipping array/object or token", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - } -} - -// Raw fetches the next item recursively as a data slice -func (r *Lexer) Raw() []byte { - r.SkipRecursive() - if !r.Ok() { - return nil - } - return r.Data[r.start:r.pos] -} - -// IsStart returns whether the lexer is positioned at the start -// of an input string. -func (r *Lexer) IsStart() bool { - return r.pos == 0 -} - -// Consumed reads all remaining bytes from the input, publishing an error if -// there is anything but whitespace remaining. -func (r *Lexer) Consumed() { - if r.pos > len(r.Data) || !r.Ok() { - return - } - - for _, c := range r.Data[r.pos:] { - if c != ' ' && c != '\t' && c != '\r' && c != '\n' { - r.AddError(&LexerError{ - Reason: "invalid character '" + string(c) + "' after top-level value", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - }) - return - } - - r.pos++ - r.start++ - } -} - -func (r *Lexer) unsafeString() (string, []byte) { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return "", nil - } - bytes := r.token.byteValue - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret, bytes -} - -// UnsafeString returns the string value if the token is a string literal. -// -// Warning: returned string may point to the input buffer, so the string should not outlive -// the input buffer. Intended pattern of usage is as an argument to a switch statement. -func (r *Lexer) UnsafeString() string { - ret, _ := r.unsafeString() - return ret -} - -// UnsafeBytes returns the byte slice if the token is a string literal. -func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString() - return ret -} - -// String reads a string literal. -func (r *Lexer) String() string { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return "" - } - ret := string(r.token.byteValue) - r.consume() - return ret -} - -// Bytes reads a string literal and base64 decodes it into a byte slice. -func (r *Lexer) Bytes() []byte { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return nil - } - ret := make([]byte, base64.StdEncoding.DecodedLen(len(r.token.byteValue))) - len, err := base64.StdEncoding.Decode(ret, r.token.byteValue) - if err != nil { - r.fatalError = &LexerError{ - Reason: err.Error(), - } - return nil - } - - r.consume() - return ret[:len] -} - -// Bool reads a true or false boolean keyword. -func (r *Lexer) Bool() bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenBool { - r.errInvalidToken("bool") - return false - } - ret := r.token.boolValue - r.consume() - return ret -} - -func (r *Lexer) number() string { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenNumber { - r.errInvalidToken("number") - return "" - } - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret -} - -func (r *Lexer) Uint8() uint8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16() uint16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32() uint32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64() uint64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Uint() uint { - return uint(r.Uint64()) -} - -func (r *Lexer) Int8() int8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int8(n) -} - -func (r *Lexer) Int16() int16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int16(n) -} - -func (r *Lexer) Int32() int32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int32(n) -} - -func (r *Lexer) Int64() int64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Int() int { - return int(r.Int64()) -} - -func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) UintStr() uint { - return uint(r.Uint64Str()) -} - -func (r *Lexer) UintptrStr() uintptr { - return uintptr(r.Uint64Str()) -} - -func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int8(n) -} - -func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int16(n) -} - -func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int32(n) -} - -func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) IntStr() int { - return int(r.Int64Str()) -} - -func (r *Lexer) Float32() float32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return float32(n) -} - -func (r *Lexer) Float64() float64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Error() error { - return r.fatalError -} - -func (r *Lexer) AddError(e error) { - if r.fatalError == nil { - r.fatalError = e - } -} - -func (r *Lexer) AddNonFatalError(e error) { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - Reason: e.Error(), - }) -} - -func (r *Lexer) addNonfatalError(err *LexerError) { - if r.UseMultipleErrors { - // We don't want to add errors with the same offset. - if len(r.multipleErrors) != 0 && r.multipleErrors[len(r.multipleErrors)-1].Offset == err.Offset { - return - } - r.multipleErrors = append(r.multipleErrors, err) - return - } - r.fatalError = err -} - -func (r *Lexer) GetNonFatalErrors() []*LexerError { - return r.multipleErrors -} - -// JsonNumber fetches and json.Number from 'encoding/json' package. -// Both int, float or string, contains them are valid values -func (r *Lexer) JsonNumber() json.Number { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() { - r.errInvalidToken("json.Number") - return json.Number("0") - } - - switch r.token.kind { - case tokenString: - return json.Number(r.String()) - case tokenNumber: - return json.Number(r.Raw()) - default: - r.errSyntax() - return json.Number("0") - } -} - -// Interface fetches an interface{} analogous to the 'encoding/json' package. -func (r *Lexer) Interface() interface{} { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() { - return nil - } - switch r.token.kind { - case tokenString: - return r.String() - case tokenNumber: - return r.Float64() - case tokenBool: - return r.Bool() - case tokenNull: - r.Null() - return nil - } - - if r.token.delimValue == '{' { - r.consume() - - ret := map[string]interface{}{} - for !r.IsDelim('}') { - key := r.String() - r.WantColon() - ret[key] = r.Interface() - r.WantComma() - } - r.Delim('}') - - if r.Ok() { - return ret - } else { - return nil - } - } else if r.token.delimValue == '[' { - r.consume() - - var ret []interface{} - for !r.IsDelim(']') { - ret = append(ret, r.Interface()) - r.WantComma() - } - r.Delim(']') - - if r.Ok() { - return ret - } else { - return nil - } - } - r.errSyntax() - return nil -} - -// WantComma requires a comma to be present before fetching next token. -func (r *Lexer) WantComma() { - r.wantSep = ',' - r.firstElement = false -} - -// WantColon requires a colon to be present before fetching next token. -func (r *Lexer) WantColon() { - r.wantSep = ':' - r.firstElement = false -} diff --git a/cmd/vendor/github.com/mailru/easyjson/jwriter/writer.go b/cmd/vendor/github.com/mailru/easyjson/jwriter/writer.go deleted file mode 100644 index e5a5ddfdbf..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ /dev/null @@ -1,377 +0,0 @@ -// Package jwriter contains a JSON writer. -package jwriter - -import ( - "io" - "strconv" - "unicode/utf8" - - "github.com/mailru/easyjson/buffer" -) - -// Flags describe various encoding options. The behavior may be actually implemented in the encoder, but -// Flags field in Writer is used to set and pass them around. -type Flags int - -const ( - NilMapAsEmpty Flags = 1 << iota // Encode nil map as '{}' rather than 'null'. - NilSliceAsEmpty // Encode nil slice as '[]' rather than 'null'. -) - -// Writer is a JSON writer. -type Writer struct { - Flags Flags - - Error error - Buffer buffer.Buffer - NoEscapeHTML bool -} - -// Size returns the size of the data that was written out. -func (w *Writer) Size() int { - return w.Buffer.Size() -} - -// DumpTo outputs the data to given io.Writer, resetting the buffer. -func (w *Writer) DumpTo(out io.Writer) (written int, err error) { - return w.Buffer.DumpTo(out) -} - -// BuildBytes returns writer data as a single byte slice. You can optionally provide one byte slice -// as argument that it will try to reuse. -func (w *Writer) BuildBytes(reuse ...[]byte) ([]byte, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.BuildBytes(reuse...), nil -} - -// ReadCloser returns an io.ReadCloser that can be used to read the data. -// ReadCloser also resets the buffer. -func (w *Writer) ReadCloser() (io.ReadCloser, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.ReadCloser(), nil -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawByte(c byte) { - w.Buffer.AppendByte(c) -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawString(s string) { - w.Buffer.AppendString(s) -} - -// Raw appends raw binary data to the buffer or sets the error if it is given. Useful for -// calling with results of MarshalJSON-like functions. -func (w *Writer) Raw(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.Buffer.AppendBytes(data) - default: - w.RawString("null") - } -} - -// RawText encloses raw binary data in quotes and appends in to the buffer. -// Useful for calling with results of MarshalText-like functions. -func (w *Writer) RawText(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.String(string(data)) - default: - w.RawString("null") - } -} - -// Base64Bytes appends data to the buffer after base64 encoding it -func (w *Writer) Base64Bytes(data []byte) { - if data == nil { - w.Buffer.AppendString("null") - return - } - w.Buffer.AppendByte('"') - w.base64(data) - w.Buffer.AppendByte('"') -} - -func (w *Writer) Uint8(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint16(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint32(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint64(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Int8(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int16(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int32(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int64(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Uint8Str(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint16Str(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint32Str(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintStr(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint64Str(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintptrStr(n uintptr) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int8Str(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int16Str(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int32Str(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) IntStr(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int64Str(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Float32(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) -} - -func (w *Writer) Float64(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, n, 'g', -1, 64) -} - -func (w *Writer) Bool(v bool) { - w.Buffer.EnsureSpace(5) - if v { - w.Buffer.Buf = append(w.Buffer.Buf, "true"...) - } else { - w.Buffer.Buf = append(w.Buffer.Buf, "false"...) - } -} - -const chars = "0123456789abcdef" - -func isNotEscapedSingleChar(c byte, escapeHTML bool) bool { - // Note: might make sense to use a table if there are more chars to escape. With 4 chars - // it benchmarks the same. - if escapeHTML { - return c != '<' && c != '>' && c != '&' && c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } else { - return c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } -} - -func (w *Writer) String(s string) { - w.Buffer.AppendByte('"') - - // Portions of the string that contain no escapes are appended as - // byte slices. - - p := 0 // last non-escape symbol - - for i := 0; i < len(s); { - c := s[i] - - if isNotEscapedSingleChar(c, !w.NoEscapeHTML) { - // single-width character, no escaping is required - i++ - continue - } else if c < utf8.RuneSelf { - // single-with character, need to escape - w.Buffer.AppendString(s[p:i]) - switch c { - case '\t': - w.Buffer.AppendString(`\t`) - case '\r': - w.Buffer.AppendString(`\r`) - case '\n': - w.Buffer.AppendString(`\n`) - case '\\': - w.Buffer.AppendString(`\\`) - case '"': - w.Buffer.AppendString(`\"`) - default: - w.Buffer.AppendString(`\u00`) - w.Buffer.AppendByte(chars[c>>4]) - w.Buffer.AppendByte(chars[c&0xf]) - } - - i++ - p = i - continue - } - - // broken utf - runeValue, runeWidth := utf8.DecodeRuneInString(s[i:]) - if runeValue == utf8.RuneError && runeWidth == 1 { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\ufffd`) - i++ - p = i - continue - } - - // jsonp stuff - tab separator and line separator - if runeValue == '\u2028' || runeValue == '\u2029' { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\u202`) - w.Buffer.AppendByte(chars[runeValue&0xf]) - i += runeWidth - p = i - continue - } - i += runeWidth - } - w.Buffer.AppendString(s[p:]) - w.Buffer.AppendByte('"') -} - -const encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -const padChar = '=' - -func (w *Writer) base64(in []byte) { - - if len(in) == 0 { - return - } - - w.Buffer.EnsureSpace(((len(in) - 1) / 3 + 1) * 4) - - si := 0 - n := (len(in) / 3) * 3 - - - for si < n { - // Convert 3x 8bit source bytes into 4 bytes - val := uint(in[si+0])<<16 | uint(in[si+1])<<8 | uint(in[si+2]) - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F], encode[val>>6&0x3F], encode[val&0x3F]) - - si += 3 - } - - remain := len(in) - si - if remain == 0 { - return - } - - // Add the remaining small block - val := uint(in[si+0]) << 16 - if remain == 2 { - val |= uint(in[si+1]) << 8 - } - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F]) - - switch remain { - case 2: - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>6&0x3F], byte(padChar)) - case 1: - w.Buffer.Buf = append(w.Buffer.Buf, byte(padChar), byte(padChar)) - } -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go deleted file mode 100644 index 6978ee9715..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Bool struct { - V bool - Defined bool -} - -// Creates an optional type with a given value. -func OBool(v bool) Bool { - return Bool{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Bool) Get(deflt bool) bool { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Bool) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Bool(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Bool) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Bool{} - } else { - v.V = l.Bool() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Bool) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Bool) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Bool) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Bool) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go deleted file mode 100644 index 643cea359e..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Float32 struct { - V float32 - Defined bool -} - -// Creates an optional type with a given value. -func OFloat32(v float32) Float32 { - return Float32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Float32) Get(deflt float32) float32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Float32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Float32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Float32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Float32{} - } else { - v.V = l.Float32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Float32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Float32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Float32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Float32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go deleted file mode 100644 index 75ae727578..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Float64 struct { - V float64 - Defined bool -} - -// Creates an optional type with a given value. -func OFloat64(v float64) Float64 { - return Float64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Float64) Get(deflt float64) float64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Float64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Float64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Float64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Float64{} - } else { - v.V = l.Float64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Float64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Float64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Float64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Float64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go deleted file mode 100644 index 469742fee9..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int struct { - V int - Defined bool -} - -// Creates an optional type with a given value. -func OInt(v int) Int { - return Int{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int) Get(deflt int) int { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int{} - } else { - v.V = l.Int() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go deleted file mode 100644 index b7723e2416..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int16 struct { - V int16 - Defined bool -} - -// Creates an optional type with a given value. -func OInt16(v int16) Int16 { - return Int16{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int16) Get(deflt int16) int16 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int16) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int16(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int16) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int16{} - } else { - v.V = l.Int16() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int16) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int16) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int16) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int16) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go deleted file mode 100644 index 7c7637a381..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int32 struct { - V int32 - Defined bool -} - -// Creates an optional type with a given value. -func OInt32(v int32) Int32 { - return Int32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int32) Get(deflt int32) int32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int32{} - } else { - v.V = l.Int32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go deleted file mode 100644 index e6ea6dc41e..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int64 struct { - V int64 - Defined bool -} - -// Creates an optional type with a given value. -func OInt64(v int64) Int64 { - return Int64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int64) Get(deflt int64) int64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int64{} - } else { - v.V = l.Int64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go deleted file mode 100644 index ddc666580b..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int8 struct { - V int8 - Defined bool -} - -// Creates an optional type with a given value. -func OInt8(v int8) Int8 { - return Int8{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int8) Get(deflt int8) int8 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int8) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int8(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int8) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int8{} - } else { - v.V = l.Int8() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int8) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int8) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int8) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int8) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go deleted file mode 100644 index 11c90b4ed5..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type String struct { - V string - Defined bool -} - -// Creates an optional type with a given value. -func OString(v string) String { - return String{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v String) Get(deflt string) string { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v String) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.String(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *String) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = String{} - } else { - v.V = l.String() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v String) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *String) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v String) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v String) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go deleted file mode 100644 index 57efd3185a..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint struct { - V uint - Defined bool -} - -// Creates an optional type with a given value. -func OUint(v uint) Uint { - return Uint{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint) Get(deflt uint) uint { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint{} - } else { - v.V = l.Uint() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go deleted file mode 100644 index f28e1d2ef2..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint16 struct { - V uint16 - Defined bool -} - -// Creates an optional type with a given value. -func OUint16(v uint16) Uint16 { - return Uint16{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint16) Get(deflt uint16) uint16 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint16) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint16(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint16) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint16{} - } else { - v.V = l.Uint16() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint16) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint16) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint16) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint16) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go deleted file mode 100644 index 9fb95c0db8..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint32 struct { - V uint32 - Defined bool -} - -// Creates an optional type with a given value. -func OUint32(v uint32) Uint32 { - return Uint32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint32) Get(deflt uint32) uint32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint32{} - } else { - v.V = l.Uint32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go deleted file mode 100644 index 0e623c62d4..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint64 struct { - V uint64 - Defined bool -} - -// Creates an optional type with a given value. -func OUint64(v uint64) Uint64 { - return Uint64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint64) Get(deflt uint64) uint64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint64{} - } else { - v.V = l.Uint64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go b/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go deleted file mode 100644 index c629e4453a..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint8 struct { - V uint8 - Defined bool -} - -// Creates an optional type with a given value. -func OUint8(v uint8) Uint8 { - return Uint8{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint8) Get(deflt uint8) uint8 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint8) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint8(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint8) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint8{} - } else { - v.V = l.Uint8() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint8) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint8) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint8) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint8) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/optional/opt.go b/cmd/vendor/github.com/mailru/easyjson/opt/optional/opt.go deleted file mode 100644 index 277dd1a3bc..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/optional/opt.go +++ /dev/null @@ -1,80 +0,0 @@ -// +build none - -package optional - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) -type A int - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Optional struct { - V A - Defined bool -} - -// Creates an optional type with a given value. -func OOptional(v A) Optional { - return Optional{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Optional) Get(deflt A) A { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Optional) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Optional(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Optional) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Optional{} - } else { - v.V = l.Optional() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Optional) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Optional) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Optional) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Optional) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/opt/opts.go b/cmd/vendor/github.com/mailru/easyjson/opt/opts.go deleted file mode 100644 index 3617f7f9f5..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/opt/opts.go +++ /dev/null @@ -1,22 +0,0 @@ -package opt - -//go:generate sed -i "s/\\+build none/generated by gotemplate/" optional/opt.go -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int(int) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint(uint) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int8(int8) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int16(int16) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int32(int32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int64(int64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint8(uint8) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint16(uint16) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint32(uint32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint64(uint64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float32(float32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float64(float64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Bool(bool) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" String(string) -//go:generate sed -i "s/generated by gotemplate/+build none/" optional/opt.go diff --git a/cmd/vendor/github.com/mailru/easyjson/parser/parser.go b/cmd/vendor/github.com/mailru/easyjson/parser/parser.go deleted file mode 100644 index 5bd06e9462..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/parser/parser.go +++ /dev/null @@ -1,97 +0,0 @@ -package parser - -import ( - "go/ast" - "go/parser" - "go/token" - "os/exec" - "strings" -) - -const structComment = "easyjson:json" - -type Parser struct { - PkgPath string - PkgName string - StructNames []string - AllStructs bool -} - -type visitor struct { - *Parser - - name string - explicit bool -} - -func (p *Parser) needType(comments string) bool { - for _, v := range strings.Split(comments, "\n") { - if strings.HasPrefix(v, structComment) { - return true - } - } - return false -} - -func (v *visitor) Visit(n ast.Node) (w ast.Visitor) { - switch n := n.(type) { - case *ast.Package: - return v - case *ast.File: - v.PkgName = n.Name.String() - return v - - case *ast.GenDecl: - v.explicit = v.needType(n.Doc.Text()) - - if !v.explicit && !v.AllStructs { - return nil - } - return v - case *ast.TypeSpec: - v.name = n.Name.String() - - // Allow to specify non-structs explicitly independent of '-all' flag. - if v.explicit { - v.StructNames = append(v.StructNames, v.name) - return nil - } - return v - case *ast.StructType: - v.StructNames = append(v.StructNames, v.name) - return nil - } - return nil -} - -func (p *Parser) Parse(fname string, isDir bool) error { - var err error - if p.PkgPath, err = getPkgPath(fname, isDir); err != nil { - return err - } - - fset := token.NewFileSet() - if isDir { - packages, err := parser.ParseDir(fset, fname, nil, parser.ParseComments) - if err != nil { - return err - } - - for _, pckg := range packages { - ast.Walk(&visitor{Parser: p}, pckg) - } - } else { - f, err := parser.ParseFile(fset, fname, nil, parser.ParseComments) - if err != nil { - return err - } - - ast.Walk(&visitor{Parser: p}, f) - } - return nil -} - -func getDefaultGoPath() (string, error) { - output, err := exec.Command("go", "env", "GOPATH").Output() - return string(output), err -} diff --git a/cmd/vendor/github.com/mailru/easyjson/parser/parser_unix.go b/cmd/vendor/github.com/mailru/easyjson/parser/parser_unix.go deleted file mode 100644 index 09b20a2e19..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/parser/parser_unix.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build !windows - -package parser - -import ( - "fmt" - "os" - "path" - "strings" -) - -func getPkgPath(fname string, isDir bool) (string, error) { - if !path.IsAbs(fname) { - pwd, err := os.Getwd() - if err != nil { - return "", err - } - fname = path.Join(pwd, fname) - } - - gopath := os.Getenv("GOPATH") - if gopath == "" { - var err error - gopath, err = getDefaultGoPath() - if err != nil { - return "", fmt.Errorf("cannot determine GOPATH: %s", err) - } - } - - for _, p := range strings.Split(os.Getenv("GOPATH"), ":") { - prefix := path.Join(p, "src") + "/" - if rel := strings.TrimPrefix(fname, prefix); rel != fname { - if !isDir { - return path.Dir(rel), nil - } else { - return path.Clean(rel), nil - } - } - } - - return "", fmt.Errorf("file '%v' is not in GOPATH", fname) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/parser/parser_windows.go b/cmd/vendor/github.com/mailru/easyjson/parser/parser_windows.go deleted file mode 100644 index 90d3a78b5a..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/parser/parser_windows.go +++ /dev/null @@ -1,49 +0,0 @@ -package parser - -import ( - "fmt" - "os" - "path" - "path/filepath" - "strings" -) - -func normalizePath(path string) string { - // use lower case, as Windows file systems will almost always be case insensitive - return strings.ToLower(strings.Replace(path, "\\", "/", -1)) -} - -func getPkgPath(fname string, isDir bool) (string, error) { - // path.IsAbs doesn't work properly on Windows; use filepath.IsAbs instead - if !filepath.IsAbs(fname) { - pwd, err := os.Getwd() - if err != nil { - return "", err - } - fname = path.Join(pwd, fname) - } - - fname = normalizePath(fname) - - gopath := os.Getenv("GOPATH") - if gopath == "" { - var err error - gopath, err = getDefaultGoPath() - if err != nil { - return "", fmt.Errorf("cannot determine GOPATH: %s", err) - } - } - - for _, p := range strings.Split(os.Getenv("GOPATH"), ";") { - prefix := path.Join(normalizePath(p), "src") + "/" - if rel := strings.TrimPrefix(fname, prefix); rel != fname { - if !isDir { - return path.Dir(rel), nil - } else { - return path.Clean(rel), nil - } - } - } - - return "", fmt.Errorf("file '%v' is not in GOPATH", fname) -} diff --git a/cmd/vendor/github.com/mailru/easyjson/raw.go b/cmd/vendor/github.com/mailru/easyjson/raw.go deleted file mode 100644 index 81bd002e19..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/raw.go +++ /dev/null @@ -1,45 +0,0 @@ -package easyjson - -import ( - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// RawMessage is a raw piece of JSON (number, string, bool, object, array or -// null) that is extracted without parsing and output as is during marshaling. -type RawMessage []byte - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v *RawMessage) MarshalEasyJSON(w *jwriter.Writer) { - if len(*v) == 0 { - w.RawString("null") - } else { - w.Raw(*v, nil) - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { - *v = RawMessage(l.Raw()) -} - -// UnmarshalJSON implements encoding/json.Unmarshaler interface. -func (v *RawMessage) UnmarshalJSON(data []byte) error { - *v = data - return nil -} - -var nullBytes = []byte("null") - -// MarshalJSON implements encoding/json.Marshaler interface. -func (v RawMessage) MarshalJSON() ([]byte, error) { - if len(v) == 0 { - return nullBytes, nil - } - return v, nil -} - -// IsDefined is required for integration with omitempty easyjson logic. -func (v *RawMessage) IsDefined() bool { - return len(*v) > 0 -} diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/data.go b/cmd/vendor/github.com/mailru/easyjson/tests/data.go deleted file mode 100644 index 145f093d69..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/data.go +++ /dev/null @@ -1,759 +0,0 @@ -package tests - -import ( - "fmt" - "math" - "net" - "time" - - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/opt" -) - -type PrimitiveTypes struct { - String string - Bool bool - - Int int - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 - - Uint uint - Uint8 uint8 - Uint16 uint16 - Uint32 uint32 - Uint64 uint64 - - IntString int `json:",string"` - Int8String int8 `json:",string"` - Int16String int16 `json:",string"` - Int32String int32 `json:",string"` - Int64String int64 `json:",string"` - - UintString uint `json:",string"` - Uint8String uint8 `json:",string"` - Uint16String uint16 `json:",string"` - Uint32String uint32 `json:",string"` - Uint64String uint64 `json:",string"` - - Float32 float32 - Float64 float64 - - Ptr *string - PtrNil *string -} - -var str = "bla" - -var primitiveTypesValue = PrimitiveTypes{ - String: "test", Bool: true, - - Int: math.MinInt32, - Int8: math.MinInt8, - Int16: math.MinInt16, - Int32: math.MinInt32, - Int64: math.MinInt64, - - Uint: math.MaxUint32, - Uint8: math.MaxUint8, - Uint16: math.MaxUint16, - Uint32: math.MaxUint32, - Uint64: math.MaxUint64, - - IntString: math.MinInt32, - Int8String: math.MinInt8, - Int16String: math.MinInt16, - Int32String: math.MinInt32, - Int64String: math.MinInt64, - - UintString: math.MaxUint32, - Uint8String: math.MaxUint8, - Uint16String: math.MaxUint16, - Uint32String: math.MaxUint32, - Uint64String: math.MaxUint64, - - Float32: 1.5, - Float64: math.MaxFloat64, - - Ptr: &str, -} - -var primitiveTypesString = "{" + - `"String":"test","Bool":true,` + - - `"Int":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int8":` + fmt.Sprint(math.MinInt8) + `,` + - `"Int16":` + fmt.Sprint(math.MinInt16) + `,` + - `"Int32":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int64":` + fmt.Sprint(int64(math.MinInt64)) + `,` + - - `"Uint":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint8":` + fmt.Sprint(math.MaxUint8) + `,` + - `"Uint16":` + fmt.Sprint(math.MaxUint16) + `,` + - `"Uint32":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint64":` + fmt.Sprint(uint64(math.MaxUint64)) + `,` + - - `"IntString":"` + fmt.Sprint(math.MinInt32) + `",` + - `"Int8String":"` + fmt.Sprint(math.MinInt8) + `",` + - `"Int16String":"` + fmt.Sprint(math.MinInt16) + `",` + - `"Int32String":"` + fmt.Sprint(math.MinInt32) + `",` + - `"Int64String":"` + fmt.Sprint(int64(math.MinInt64)) + `",` + - - `"UintString":"` + fmt.Sprint(uint32(math.MaxUint32)) + `",` + - `"Uint8String":"` + fmt.Sprint(math.MaxUint8) + `",` + - `"Uint16String":"` + fmt.Sprint(math.MaxUint16) + `",` + - `"Uint32String":"` + fmt.Sprint(uint32(math.MaxUint32)) + `",` + - `"Uint64String":"` + fmt.Sprint(uint64(math.MaxUint64)) + `",` + - - `"Float32":` + fmt.Sprint(1.5) + `,` + - `"Float64":` + fmt.Sprint(math.MaxFloat64) + `,` + - - `"Ptr":"bla",` + - `"PtrNil":null` + - - "}" - -type ( - NamedString string - NamedBool bool - - NamedInt int - NamedInt8 int8 - NamedInt16 int16 - NamedInt32 int32 - NamedInt64 int64 - - NamedUint uint - NamedUint8 uint8 - NamedUint16 uint16 - NamedUint32 uint32 - NamedUint64 uint64 - - NamedFloat32 float32 - NamedFloat64 float64 - - NamedStrPtr *string -) - -type NamedPrimitiveTypes struct { - String NamedString - Bool NamedBool - - Int NamedInt - Int8 NamedInt8 - Int16 NamedInt16 - Int32 NamedInt32 - Int64 NamedInt64 - - Uint NamedUint - Uint8 NamedUint8 - Uint16 NamedUint16 - Uint32 NamedUint32 - Uint64 NamedUint64 - - Float32 NamedFloat32 - Float64 NamedFloat64 - - Ptr NamedStrPtr - PtrNil NamedStrPtr -} - -var namedPrimitiveTypesValue = NamedPrimitiveTypes{ - String: "test", - Bool: true, - - Int: math.MinInt32, - Int8: math.MinInt8, - Int16: math.MinInt16, - Int32: math.MinInt32, - Int64: math.MinInt64, - - Uint: math.MaxUint32, - Uint8: math.MaxUint8, - Uint16: math.MaxUint16, - Uint32: math.MaxUint32, - Uint64: math.MaxUint64, - - Float32: 1.5, - Float64: math.MaxFloat64, - - Ptr: NamedStrPtr(&str), -} - -var namedPrimitiveTypesString = "{" + - `"String":"test",` + - `"Bool":true,` + - - `"Int":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int8":` + fmt.Sprint(math.MinInt8) + `,` + - `"Int16":` + fmt.Sprint(math.MinInt16) + `,` + - `"Int32":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int64":` + fmt.Sprint(int64(math.MinInt64)) + `,` + - - `"Uint":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint8":` + fmt.Sprint(math.MaxUint8) + `,` + - `"Uint16":` + fmt.Sprint(math.MaxUint16) + `,` + - `"Uint32":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint64":` + fmt.Sprint(uint64(math.MaxUint64)) + `,` + - - `"Float32":` + fmt.Sprint(1.5) + `,` + - `"Float64":` + fmt.Sprint(math.MaxFloat64) + `,` + - - `"Ptr":"bla",` + - `"PtrNil":null` + - "}" - -type SubStruct struct { - Value string - Value2 string - unexpored bool -} - -type SubP struct { - V string -} - -type SubStructAlias SubStruct - -type Structs struct { - SubStruct - *SubP - - Value2 int - - Sub1 SubStruct `json:"substruct"` - Sub2 *SubStruct - SubNil *SubStruct - - SubSlice []SubStruct - SubSliceNil []SubStruct - - SubPtrSlice []*SubStruct - SubPtrSliceNil []*SubStruct - - SubA1 SubStructAlias - SubA2 *SubStructAlias - - Anonymous struct { - V string - I int - } - Anonymous1 *struct { - V string - } - - AnonymousSlice []struct{ V int } - AnonymousPtrSlice []*struct{ V int } - - Slice []string - - unexported bool -} - -var structsValue = Structs{ - SubStruct: SubStruct{Value: "test"}, - SubP: &SubP{V: "subp"}, - - Value2: 5, - - Sub1: SubStruct{Value: "test1", Value2: "v"}, - Sub2: &SubStruct{Value: "test2", Value2: "v2"}, - - SubSlice: []SubStruct{ - {Value: "s1"}, - {Value: "s2"}, - }, - - SubPtrSlice: []*SubStruct{ - {Value: "p1"}, - {Value: "p2"}, - }, - - SubA1: SubStructAlias{Value: "test3", Value2: "v3"}, - SubA2: &SubStructAlias{Value: "test4", Value2: "v4"}, - - Anonymous: struct { - V string - I int - }{V: "bla", I: 5}, - - Anonymous1: &struct { - V string - }{V: "bla1"}, - - AnonymousSlice: []struct{ V int }{{1}, {2}}, - AnonymousPtrSlice: []*struct{ V int }{{3}, {4}}, - - Slice: []string{"test5", "test6"}, -} - -var structsString = "{" + - `"Value2":5,` + - - `"substruct":{"Value":"test1","Value2":"v"},` + - `"Sub2":{"Value":"test2","Value2":"v2"},` + - `"SubNil":null,` + - - `"SubSlice":[{"Value":"s1","Value2":""},{"Value":"s2","Value2":""}],` + - `"SubSliceNil":null,` + - - `"SubPtrSlice":[{"Value":"p1","Value2":""},{"Value":"p2","Value2":""}],` + - `"SubPtrSliceNil":null,` + - - `"SubA1":{"Value":"test3","Value2":"v3"},` + - `"SubA2":{"Value":"test4","Value2":"v4"},` + - - `"Anonymous":{"V":"bla","I":5},` + - `"Anonymous1":{"V":"bla1"},` + - - `"AnonymousSlice":[{"V":1},{"V":2}],` + - `"AnonymousPtrSlice":[{"V":3},{"V":4}],` + - - `"Slice":["test5","test6"],` + - - // Embedded fields go last. - `"V":"subp",` + - `"Value":"test"` + - "}" - -type OmitEmpty struct { - // NOTE: first field is empty to test comma printing. - - StrE, StrNE string `json:",omitempty"` - PtrE, PtrNE *string `json:",omitempty"` - - IntNE int `json:"intField,omitempty"` - IntE int `json:",omitempty"` - - // NOTE: omitempty has no effect on non-pointer struct fields. - SubE, SubNE SubStruct `json:",omitempty"` - SubPE, SubPNE *SubStruct `json:",omitempty"` -} - -var omitEmptyValue = OmitEmpty{ - StrNE: "str", - PtrNE: &str, - IntNE: 6, - SubNE: SubStruct{Value: "1", Value2: "2"}, - SubPNE: &SubStruct{Value: "3", Value2: "4"}, -} - -var omitEmptyString = "{" + - `"StrNE":"str",` + - `"PtrNE":"bla",` + - `"intField":6,` + - `"SubE":{"Value":"","Value2":""},` + - `"SubNE":{"Value":"1","Value2":"2"},` + - `"SubPNE":{"Value":"3","Value2":"4"}` + - "}" - -type Opts struct { - StrNull opt.String - StrEmpty opt.String - Str opt.String - StrOmitempty opt.String `json:",omitempty"` - - IntNull opt.Int - IntZero opt.Int - Int opt.Int -} - -var optsValue = Opts{ - StrEmpty: opt.OString(""), - Str: opt.OString("test"), - - IntZero: opt.OInt(0), - Int: opt.OInt(5), -} - -var optsString = `{` + - `"StrNull":null,` + - `"StrEmpty":"",` + - `"Str":"test",` + - `"IntNull":null,` + - `"IntZero":0,` + - `"Int":5` + - `}` - -type Raw struct { - Field easyjson.RawMessage - Field2 string -} - -var rawValue = Raw{ - Field: []byte(`{"a" : "b"}`), - Field2: "test", -} - -var rawString = `{` + - `"Field":{"a" : "b"},` + - `"Field2":"test"` + - `}` - -type StdMarshaler struct { - T time.Time - IP net.IP -} - -var stdMarshalerValue = StdMarshaler{ - T: time.Date(2016, 01, 02, 14, 15, 10, 0, time.UTC), - IP: net.IPv4(192, 168, 0, 1), -} -var stdMarshalerString = `{` + - `"T":"2016-01-02T14:15:10Z",` + - `"IP":"192.168.0.1"` + - `}` - -type UserMarshaler struct { - V vMarshaler - T tMarshaler -} - -type vMarshaler net.IP - -func (v vMarshaler) MarshalJSON() ([]byte, error) { - return []byte(`"0::0"`), nil -} - -func (v *vMarshaler) UnmarshalJSON([]byte) error { - *v = vMarshaler(net.IPv6zero) - return nil -} - -type tMarshaler net.IP - -func (v tMarshaler) MarshalText() ([]byte, error) { - return []byte(`[0::0]`), nil -} - -func (v *tMarshaler) UnmarshalText([]byte) error { - *v = tMarshaler(net.IPv6zero) - return nil -} - -var userMarshalerValue = UserMarshaler{ - V: vMarshaler(net.IPv6zero), - T: tMarshaler(net.IPv6zero), -} -var userMarshalerString = `{` + - `"V":"0::0",` + - `"T":"[0::0]"` + - `}` - -type unexportedStruct struct { - Value string -} - -var unexportedStructValue = unexportedStruct{"test"} -var unexportedStructString = `{"Value":"test"}` - -type ExcludedField struct { - Process bool `json:"process"` - DoNotProcess bool `json:"-"` - DoNotProcess1 bool `json:"-"` -} - -var excludedFieldValue = ExcludedField{ - Process: true, - DoNotProcess: false, - DoNotProcess1: false, -} -var excludedFieldString = `{"process":true}` - -type Slices struct { - ByteSlice []byte - EmptyByteSlice []byte - NilByteSlice []byte - IntSlice []int - EmptyIntSlice []int - NilIntSlice []int -} - -var sliceValue = Slices{ - ByteSlice: []byte("abc"), - EmptyByteSlice: []byte{}, - NilByteSlice: []byte(nil), - IntSlice: []int{1, 2, 3, 4, 5}, - EmptyIntSlice: []int{}, - NilIntSlice: []int(nil), -} - -var sliceString = `{` + - `"ByteSlice":"YWJj",` + - `"EmptyByteSlice":"",` + - `"NilByteSlice":null,` + - `"IntSlice":[1,2,3,4,5],` + - `"EmptyIntSlice":[],` + - `"NilIntSlice":null` + - `}` - -type Arrays struct { - ByteArray [3]byte - EmptyByteArray [0]byte - IntArray [5]int - EmptyIntArray [0]int -} - -var arrayValue = Arrays{ - ByteArray: [3]byte{'a', 'b', 'c'}, - EmptyByteArray: [0]byte{}, - IntArray: [5]int{1, 2, 3, 4, 5}, - EmptyIntArray: [0]int{}, -} - -var arrayString = `{` + - `"ByteArray":"YWJj",` + - `"EmptyByteArray":"",` + - `"IntArray":[1,2,3,4,5],` + - `"EmptyIntArray":[]` + - `}` - -var arrayOverflowString = `{` + - `"ByteArray":"YWJjbnNk",` + - `"EmptyByteArray":"YWJj",` + - `"IntArray":[1,2,3,4,5,6],` + - `"EmptyIntArray":[7,8]` + - `}` - -var arrayUnderflowValue = Arrays{ - ByteArray: [3]byte{'x', 0, 0}, - EmptyByteArray: [0]byte{}, - IntArray: [5]int{1, 2, 0, 0, 0}, - EmptyIntArray: [0]int{}, -} - -var arrayUnderflowString = `{` + - `"ByteArray":"eA==",` + - `"IntArray":[1,2]` + - `}` - -type Str string - -type Maps struct { - Map map[string]string - InterfaceMap map[string]interface{} - NilMap map[string]string - - CustomMap map[Str]Str -} - -var mapsValue = Maps{ - Map: map[string]string{"A": "b"}, // only one item since map iteration is randomized - InterfaceMap: map[string]interface{}{"G": float64(1)}, - - CustomMap: map[Str]Str{"c": "d"}, -} - -var mapsString = `{` + - `"Map":{"A":"b"},` + - `"InterfaceMap":{"G":1},` + - `"NilMap":null,` + - `"CustomMap":{"c":"d"}` + - `}` - -type NamedSlice []Str -type NamedMap map[Str]Str - -type DeepNest struct { - SliceMap map[Str][]Str - SliceMap1 map[Str][]Str - SliceMap2 map[Str][]Str - NamedSliceMap map[Str]NamedSlice - NamedMapMap map[Str]NamedMap - MapSlice []map[Str]Str - NamedSliceSlice []NamedSlice - NamedMapSlice []NamedMap - NamedStringSlice []NamedString -} - -var deepNestValue = DeepNest{ - SliceMap: map[Str][]Str{ - "testSliceMap": []Str{ - "0", - "1", - }, - }, - SliceMap1: map[Str][]Str{ - "testSliceMap1": []Str(nil), - }, - SliceMap2: map[Str][]Str{ - "testSliceMap2": []Str{}, - }, - NamedSliceMap: map[Str]NamedSlice{ - "testNamedSliceMap": NamedSlice{ - "2", - "3", - }, - }, - NamedMapMap: map[Str]NamedMap{ - "testNamedMapMap": NamedMap{ - "key1": "value1", - }, - }, - MapSlice: []map[Str]Str{ - map[Str]Str{ - "testMapSlice": "someValue", - }, - }, - NamedSliceSlice: []NamedSlice{ - NamedSlice{ - "someValue1", - "someValue2", - }, - NamedSlice{ - "someValue3", - "someValue4", - }, - }, - NamedMapSlice: []NamedMap{ - NamedMap{ - "key2": "value2", - }, - NamedMap{ - "key3": "value3", - }, - }, - NamedStringSlice: []NamedString{ - "value4", "value5", - }, -} - -var deepNestString = `{` + - `"SliceMap":{` + - `"testSliceMap":["0","1"]` + - `},` + - `"SliceMap1":{` + - `"testSliceMap1":null` + - `},` + - `"SliceMap2":{` + - `"testSliceMap2":[]` + - `},` + - `"NamedSliceMap":{` + - `"testNamedSliceMap":["2","3"]` + - `},` + - `"NamedMapMap":{` + - `"testNamedMapMap":{"key1":"value1"}` + - `},` + - `"MapSlice":[` + - `{"testMapSlice":"someValue"}` + - `],` + - `"NamedSliceSlice":[` + - `["someValue1","someValue2"],` + - `["someValue3","someValue4"]` + - `],` + - `"NamedMapSlice":[` + - `{"key2":"value2"},` + - `{"key3":"value3"}` + - `],` + - `"NamedStringSlice":["value4","value5"]` + - `}` - -//easyjson:json -type Ints []int - -var IntsValue = Ints{1, 2, 3, 4, 5} - -var IntsString = `[1,2,3,4,5]` - -//easyjson:json -type MapStringString map[string]string - -var mapStringStringValue = MapStringString{"a": "b"} - -var mapStringStringString = `{"a":"b"}` - -type RequiredOptionalStruct struct { - FirstName string `json:"first_name,required"` - Lastname string `json:"last_name"` -} - -//easyjson:json -type EncodingFlagsTestMap struct { - F map[string]string -} - -//easyjson:json -type EncodingFlagsTestSlice struct { - F []string -} - -type StructWithInterface struct { - Field1 int `json:"f1"` - Field2 interface{} `json:"f2"` - Field3 string `json:"f3"` -} - -type EmbeddedStruct struct { - Field1 int `json:"f1"` - Field2 string `json:"f2"` -} - -var structWithInterfaceString = `{"f1":1,"f2":{"f1":11,"f2":"22"},"f3":"3"}` -var structWithInterfaceValueFilled = StructWithInterface{1, &EmbeddedStruct{11, "22"}, "3"} - -//easyjson:json -type MapIntString map[int]string - -var mapIntStringValue = MapIntString{3: "hi"} -var mapIntStringValueString = `{"3":"hi"}` - -//easyjson:json -type MapInt32String map[int32]string - -var mapInt32StringValue = MapInt32String{-354634382: "life"} -var mapInt32StringValueString = `{"-354634382":"life"}` - -//easyjson:json -type MapInt64String map[int64]string - -var mapInt64StringValue = MapInt64String{-3546343826724305832: "life"} -var mapInt64StringValueString = `{"-3546343826724305832":"life"}` - -//easyjson:json -type MapUintString map[uint]string - -var mapUintStringValue = MapUintString{42: "life"} -var mapUintStringValueString = `{"42":"life"}` - -//easyjson:json -type MapUint32String map[uint32]string - -var mapUint32StringValue = MapUint32String{354634382: "life"} -var mapUint32StringValueString = `{"354634382":"life"}` - -//easyjson:json -type MapUint64String map[uint64]string - -var mapUint64StringValue = MapUint64String{3546343826724305832: "life"} -var mapUint64StringValueString = `{"3546343826724305832":"life"}` - -//easyjson:json -type MapUintptrString map[uintptr]string - -var mapUintptrStringValue = MapUintptrString{272679208: "obj"} -var mapUintptrStringValueString = `{"272679208":"obj"}` - -type MyInt int - -//easyjson:json -type MapMyIntString map[MyInt]string - -var mapMyIntStringValue = MapMyIntString{MyInt(42): "life"} -var mapMyIntStringValueString = `{"42":"life"}` - -//easyjson:json -type IntKeyedMapStruct struct { - Foo MapMyIntString `json:"foo"` - Bar map[int16]MapUint32String `json:"bar"` -} - -var intKeyedMapStructValue = IntKeyedMapStruct{ - Foo: mapMyIntStringValue, - Bar: map[int16]MapUint32String{32: mapUint32StringValue}, -} -var intKeyedMapStructValueString = `{` + - `"foo":{"42":"life"},` + - `"bar":{"32":{"354634382":"life"}}` + - `}` diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/errors.go b/cmd/vendor/github.com/mailru/easyjson/tests/errors.go deleted file mode 100644 index 14360fcc29..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/errors.go +++ /dev/null @@ -1,26 +0,0 @@ -package tests - -//easyjson:json -type ErrorIntSlice []int - -//easyjson:json -type ErrorBoolSlice []bool - -//easyjson:json -type ErrorUintSlice []uint - -//easyjson:json -type ErrorStruct struct { - Int int `json:"int"` - String string `json:"string"` - Slice []int `json:"slice"` - IntSlice []int `json:"int_slice"` -} - -type ErrorNestedStruct struct { - ErrorStruct ErrorStruct `json:"error_struct"` - Int int `json:"int"` -} - -//easyjson:json -type ErrorIntMap map[uint32]string diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/named_type.go b/cmd/vendor/github.com/mailru/easyjson/tests/named_type.go deleted file mode 100644 index 0ff8dfeb37..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/named_type.go +++ /dev/null @@ -1,22 +0,0 @@ -package tests - -//easyjson:json -type NamedType struct { - Inner struct { - // easyjson is mistakenly naming the type of this field 'tests.MyString' in the generated output - // something about a named type inside an anonmymous type is triggering this bug - Field MyString `tag:"value"` - Field2 int "tag:\"value with ` in it\"" - } -} - -type MyString string - -var namedTypeValue NamedType - -func init() { - namedTypeValue.Inner.Field = "test" - namedTypeValue.Inner.Field2 = 123 -} - -var namedTypeValueString = `{"Inner":{"Field":"test","Field2":123}}` diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/nested_easy.go b/cmd/vendor/github.com/mailru/easyjson/tests/nested_easy.go deleted file mode 100644 index 6309a49f9f..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/nested_easy.go +++ /dev/null @@ -1,25 +0,0 @@ -package tests - -import ( - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/jwriter" -) - -//easyjson:json -type NestedInterfaces struct { - Value interface{} - Slice []interface{} - Map map[string]interface{} -} - -type NestedEasyMarshaler struct { - EasilyMarshaled bool -} - -var _ easyjson.Marshaler = &NestedEasyMarshaler{} - -func (i *NestedEasyMarshaler) MarshalEasyJSON(w *jwriter.Writer) { - // We use this method only to indicate that easyjson.Marshaler - // interface was really used while encoding. - i.EasilyMarshaled = true -} \ No newline at end of file diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/nothing.go b/cmd/vendor/github.com/mailru/easyjson/tests/nothing.go deleted file mode 100644 index 35334f5f5e..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/nothing.go +++ /dev/null @@ -1,3 +0,0 @@ -package tests - -// No structs in this file diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/omitempty.go b/cmd/vendor/github.com/mailru/easyjson/tests/omitempty.go deleted file mode 100644 index ede5eb95a7..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/omitempty.go +++ /dev/null @@ -1,12 +0,0 @@ -package tests - -//easyjson:json -type OmitEmptyDefault struct { - Field string - Str string - Str1 string `json:"s,!omitempty"` - Str2 string `json:",!omitempty"` -} - -var omitEmptyDefaultValue = OmitEmptyDefault{Field: "test"} -var omitEmptyDefaultString = `{"Field":"test","s":"","Str2":""}` diff --git a/cmd/vendor/github.com/mailru/easyjson/tests/snake.go b/cmd/vendor/github.com/mailru/easyjson/tests/snake.go deleted file mode 100644 index 9b64f86120..0000000000 --- a/cmd/vendor/github.com/mailru/easyjson/tests/snake.go +++ /dev/null @@ -1,10 +0,0 @@ -package tests - -//easyjson:json -type SnakeStruct struct { - WeirdHTTPStuff bool - CustomNamedField string `json:"cUsToM"` -} - -var snakeStructValue SnakeStruct -var snakeStructString = `{"weird_http_stuff":false,"cUsToM":""}` diff --git a/cmd/vendor/github.com/markbates/inflect/helpers.go b/cmd/vendor/github.com/markbates/inflect/helpers.go index 1d41865a9c..24050c70a0 100644 --- a/cmd/vendor/github.com/markbates/inflect/helpers.go +++ b/cmd/vendor/github.com/markbates/inflect/helpers.go @@ -1,5 +1,6 @@ package inflect +//Helpers is a map of the helper names with its corresponding inflect function var Helpers = map[string]interface{}{ "asciffy": Asciify, "camelize": Camelize, diff --git a/cmd/vendor/github.com/markbates/inflect/inflect.go b/cmd/vendor/github.com/markbates/inflect/inflect.go index f7e410d407..9a13a0a8c1 100644 --- a/cmd/vendor/github.com/markbates/inflect/inflect.go +++ b/cmd/vendor/github.com/markbates/inflect/inflect.go @@ -16,7 +16,7 @@ import ( ) // baseAcronyms comes from https://en.wikipedia.org/wiki/List_of_information_technology_acronymss -const baseAcronyms = `ACK,ACL,ADSL,AES,ANSI,API,ARP,ATM,BGP,BSS,CAT,CCITT,CHAP,CIDR,CIR,CLI,CPE,CPU,CRC,CRT,CSMA,CMOS,DCE,DEC,DES,DHCP,DNS,DRAM,DSL,DSLAM,DTE,DMI,EHA,EIA,EIGRP,EOF,ESS,FCC,FCS,FDDI,FTP,GBIC,gbps,GEPOF,HDLC,HTTP,HTTPS,IANA,ICMP,IDF,IDS,IEEE,IETF,IMAP,IP,IPS,ISDN,ISP,kbps,LACP,LAN,LAPB,LAPF,LLC,MAC,MAN,Mbps,MC,MDF,MIB,MoCA,MPLS,MTU,NAC,NAT,NBMA,NIC,NRZ,NRZI,NVRAM,OSI,OSPF,OUI,PAP,PAT,PC,PIM,PIM,PCM,PDU,POP3,POP,POST,POTS,PPP,PPTP,PTT,PVST,RADIUS,RAM,RARP,RFC,RIP,RLL,ROM,RSTP,RTP,RCP,SDLC,SFD,SFP,SLARP,SLIP,SMTP,SNA,SNAP,SNMP,SOF,SRAM,SSH,SSID,STP,SYN,TDM,TFTP,TIA,TOFU,UDP,URL,URI,USB,UTP,VC,VLAN,VLSM,VPN,W3C,WAN,WEP,WiFi,WPA,WWW` +const baseAcronyms = `JSON,JWT,ID,UUID,SQL,ACK,ACL,ADSL,AES,ANSI,API,ARP,ATM,BGP,BSS,CAT,CCITT,CHAP,CIDR,CIR,CLI,CPE,CPU,CRC,CRT,CSMA,CMOS,DCE,DEC,DES,DHCP,DNS,DRAM,DSL,DSLAM,DTE,DMI,EHA,EIA,EIGRP,EOF,ESS,FCC,FCS,FDDI,FTP,GBIC,gbps,GEPOF,HDLC,HTTP,HTTPS,IANA,ICMP,IDF,IDS,IEEE,IETF,IMAP,IP,IPS,ISDN,ISP,kbps,LACP,LAN,LAPB,LAPF,LLC,MAC,MAN,Mbps,MC,MDF,MIB,MoCA,MPLS,MTU,NAC,NAT,NBMA,NIC,NRZ,NRZI,NVRAM,OSI,OSPF,OUI,PAP,PAT,PC,PIM,PIM,PCM,PDU,POP3,POP,POST,POTS,PPP,PPTP,PTT,PVST,RADIUS,RAM,RARP,RFC,RIP,RLL,ROM,RSTP,RTP,RCP,SDLC,SFD,SFP,SLARP,SLIP,SMTP,SNA,SNAP,SNMP,SOF,SRAM,SSH,SSID,STP,SYN,TDM,TFTP,TIA,TOFU,UDP,URL,URI,USB,UTP,VC,VLAN,VLSM,VPN,W3C,WAN,WEP,WiFi,WPA,WWW` // Rule used by rulesets type Rule struct { @@ -35,7 +35,7 @@ type Ruleset struct { acronyms []*Rule } -// create a blank ruleset. Unless you are going to +// NewRuleset creates a blank ruleset. Unless you are going to // build your own rules from scratch you probably // won't need this and can just use the defaultRuleset // via the global inflect.* methods @@ -49,7 +49,7 @@ func NewRuleset() *Ruleset { return rs } -// create a new ruleset and load it with the default +// NewDefaultRuleset creates a new ruleset and load it with the default // set of common English pluralization rules func NewDefaultRuleset() *Ruleset { rs := NewRuleset() @@ -267,16 +267,17 @@ func NewDefaultRuleset() *Ruleset { return rs } +// Uncountables returns a map of uncountables in the ruleset func (rs *Ruleset) Uncountables() map[string]bool { return rs.uncountables } -// add a pluralization rule +// AddPlural add a pluralization rule func (rs *Ruleset) AddPlural(suffix, replacement string) { rs.AddPluralExact(suffix, replacement, false) } -// add a pluralization rule with full string match +// AddPluralExact add a pluralization rule with full string match func (rs *Ruleset) AddPluralExact(suffix, replacement string, exact bool) { // remove uncountable delete(rs.uncountables, suffix) @@ -289,12 +290,12 @@ func (rs *Ruleset) AddPluralExact(suffix, replacement string, exact bool) { rs.plurals = append([]*Rule{r}, rs.plurals...) } -// add a singular rule +// AddSingular add a singular rule func (rs *Ruleset) AddSingular(suffix, replacement string) { rs.AddSingularExact(suffix, replacement, false) } -// same as AddSingular but you can set `exact` to force +// AddSingularExact same as AddSingular but you can set `exact` to force // a full string match func (rs *Ruleset) AddSingularExact(suffix, replacement string, exact bool) { // remove from uncountable @@ -307,7 +308,7 @@ func (rs *Ruleset) AddSingularExact(suffix, replacement string, exact bool) { rs.singulars = append([]*Rule{r}, rs.singulars...) } -// Human rules are applied by humanize to show more friendly +// AddHuman Human rules are applied by humanize to show more friendly // versions of words func (rs *Ruleset) AddHuman(suffix, replacement string) { r := new(Rule) @@ -316,7 +317,7 @@ func (rs *Ruleset) AddHuman(suffix, replacement string) { rs.humans = append([]*Rule{r}, rs.humans...) } -// Add any inconsistent pluralizing/singularizing rules +// AddIrregular Add any inconsistent pluralizing/singularizing rules // to the set here. func (rs *Ruleset) AddIrregular(singular, plural string) { delete(rs.uncountables, singular) @@ -326,7 +327,7 @@ func (rs *Ruleset) AddIrregular(singular, plural string) { rs.AddSingular(plural, singular) } -// if you use acronym you may need to add them to the ruleset +// AddAcronym if you use acronym you may need to add them to the ruleset // to prevent Underscored words of things like "HTML" coming out // as "h_t_m_l" func (rs *Ruleset) AddAcronym(word string) { @@ -336,7 +337,7 @@ func (rs *Ruleset) AddAcronym(word string) { rs.acronyms = append(rs.acronyms, r) } -// add a word to this ruleset that has the same singular and plural form +// AddUncountable add a word to this ruleset that has the same singular and plural form // for example: "rice" func (rs *Ruleset) AddUncountable(word string) { rs.uncountables[strings.ToLower(word)] = true @@ -354,7 +355,7 @@ func (rs *Ruleset) isUncountable(word string) bool { //isAcronym returns if a word is acronym or not. func (rs *Ruleset) isAcronym(word string) bool { for _, rule := range rs.acronyms { - if rule.suffix == word { + if strings.ToUpper(rule.suffix) == strings.ToUpper(word) { return true } } @@ -362,6 +363,7 @@ func (rs *Ruleset) isAcronym(word string) bool { return false } +//PluralizeWithSize pluralize with taking number into account func (rs *Ruleset) PluralizeWithSize(word string, size int) string { if size == 1 { return rs.Singularize(word) @@ -369,7 +371,7 @@ func (rs *Ruleset) PluralizeWithSize(word string, size int) string { return rs.Pluralize(word) } -// returns the plural form of a singular word +// Pluralize returns the plural form of a singular word func (rs *Ruleset) Pluralize(word string) string { if len(word) == 0 { return word @@ -378,25 +380,36 @@ func (rs *Ruleset) Pluralize(word string) string { if rs.isUncountable(lWord) { return word } + + var candidate string for _, rule := range rs.plurals { if rule.exact { if lWord == rule.suffix { // Capitalized word if lWord[0] != word[0] && lWord[1:] == word[1:] { - return Capitalize(rule.replacement) + return rs.Capitalize(rule.replacement) } return rule.replacement } - } else { - if strings.HasSuffix(word, rule.suffix) { - return replaceLast(word, rule.suffix, rule.replacement) - } + continue } + + if strings.EqualFold(word, rule.suffix) { + candidate = rule.replacement + } + + if strings.HasSuffix(word, rule.suffix) { + return replaceLast(word, rule.suffix, rule.replacement) + } + } + + if candidate != "" { + return candidate } return word + "s" } -// returns the singular form of a plural word +//Singularize returns the singular form of a plural word func (rs *Ruleset) Singularize(word string) string { if len(word) <= 1 { return word @@ -405,48 +418,61 @@ func (rs *Ruleset) Singularize(word string) string { if rs.isUncountable(lWord) { return word } + + var candidate string + for _, rule := range rs.singulars { if rule.exact { if lWord == rule.suffix { // Capitalized word if lWord[0] != word[0] && lWord[1:] == word[1:] { - return Capitalize(rule.replacement) + return rs.Capitalize(rule.replacement) } return rule.replacement } - } else { - if strings.HasSuffix(word, rule.suffix) { - return replaceLast(word, rule.suffix, rule.replacement) - } + continue } + + if strings.EqualFold(word, rule.suffix) { + candidate = rule.replacement + } + + if strings.HasSuffix(word, rule.suffix) { + return replaceLast(word, rule.suffix, rule.replacement) + } + } + + if candidate != "" { + return candidate } + return word } -// uppercase first character +//Capitalize uppercase first character func (rs *Ruleset) Capitalize(word string) string { - if strings.ToLower(word) == "id" { - return "ID" + if rs.isAcronym(word) { + return strings.ToUpper(word) } return strings.ToUpper(word[:1]) + word[1:] } -// "dino_party" -> "DinoParty" +//Camelize "dino_party" -> "DinoParty" func (rs *Ruleset) Camelize(word string) string { - if strings.ToLower(word) == "id" { - return "ID" + if rs.isAcronym(word) { + return strings.ToUpper(word) } words := splitAtCaseChangeWithTitlecase(word) return strings.Join(words, "") } -// same as Camelcase but with first letter downcased +//CamelizeDownFirst same as Camelcase but with first letter downcased func (rs *Ruleset) CamelizeDownFirst(word string) string { word = Camelize(word) return strings.ToLower(word[:1]) + word[1:] } -// Capitalize every word in sentence "hello there" -> "Hello There" +//Titleize Capitalize every word in sentence "hello there" -> "Hello There" func (rs *Ruleset) Titleize(word string) string { words := splitAtCaseChangeWithTitlecase(word) result := strings.Join(words, " ") @@ -486,12 +512,12 @@ func (rs *Ruleset) separatedWords(word, sep string) string { return strings.Join(words, sep) } -// lowercase underscore version "BigBen" -> "big_ben" +//Underscore lowercase underscore version "BigBen" -> "big_ben" func (rs *Ruleset) Underscore(word string) string { return rs.separatedWords(word, "_") } -// First letter of sentence capitalized +//Humanize First letter of sentence capitalized // Uses custom friendly replacements via AddHuman() func (rs *Ruleset) Humanize(word string) string { word = replaceLast(word, "_id", "") // strip foreign key kinds @@ -505,29 +531,29 @@ func (rs *Ruleset) Humanize(word string) string { return string(unicode.ToUpper(r)) + sentence[n:] } -// an underscored foreign key name "Person" -> "person_id" +//ForeignKey an underscored foreign key name "Person" -> "person_id" func (rs *Ruleset) ForeignKey(word string) string { return rs.Underscore(rs.Singularize(word)) + "_id" } -// a foreign key (with an underscore) "Person" -> "personid" +//ForeignKeyCondensed a foreign key (with an underscore) "Person" -> "personid" func (rs *Ruleset) ForeignKeyCondensed(word string) string { return rs.Underscore(word) + "id" } -// Rails style pluralized table names: "SuperPerson" -> "super_people" +//Tableize Rails style pluralized table names: "SuperPerson" -> "super_people" func (rs *Ruleset) Tableize(word string) string { return rs.Pluralize(rs.Underscore(rs.Typeify(word))) } var notUrlSafe *regexp.Regexp = regexp.MustCompile(`[^\w\d\-_ ]`) -// param safe dasherized names like "my-param" +//Parameterize param safe dasherized names like "my-param" func (rs *Ruleset) Parameterize(word string) string { return ParameterizeJoin(word, "-") } -// param safe dasherized names with custom separator +//ParameterizeJoin param safe dasherized names with custom separator func (rs *Ruleset) ParameterizeJoin(word, sep string) string { word = strings.ToLower(word) word = rs.Asciify(word) @@ -543,7 +569,7 @@ func (rs *Ruleset) ParameterizeJoin(word, sep string) string { return word } -var lookalikes map[string]*regexp.Regexp = map[string]*regexp.Regexp{ +var lookalikes = map[string]*regexp.Regexp{ "A": regexp.MustCompile(`À|Á|Â|Ã|Ä|Å`), "AE": regexp.MustCompile(`Æ`), "C": regexp.MustCompile(`Ç`), @@ -569,7 +595,7 @@ var lookalikes map[string]*regexp.Regexp = map[string]*regexp.Regexp{ "y": regexp.MustCompile(`ý|ÿ`), } -// transforms Latin characters like é -> e +//Asciify transforms Latin characters like é -> e func (rs *Ruleset) Asciify(word string) string { for repl, regex := range lookalikes { word = regex.ReplaceAllString(word, repl) @@ -577,20 +603,20 @@ func (rs *Ruleset) Asciify(word string) string { return word } -var tablePrefix *regexp.Regexp = regexp.MustCompile(`^[^.]*\.`) +var tablePrefix = regexp.MustCompile(`^[^.]*\.`) -// "something_like_this" -> "SomethingLikeThis" +//Typeify "something_like_this" -> "SomethingLikeThis" func (rs *Ruleset) Typeify(word string) string { word = tablePrefix.ReplaceAllString(word, "") return rs.Camelize(rs.Singularize(word)) } -// "SomeText" -> "some-text" +//Dasherize "SomeText" -> "some-text" func (rs *Ruleset) Dasherize(word string) string { return rs.separatedWords(word, "-") } -// "1031" -> "1031st" +//Ordinalize "1031" -> "1031st" func (rs *Ruleset) Ordinalize(str string) string { number, err := strconv.Atoi(str) if err != nil { @@ -612,6 +638,7 @@ func (rs *Ruleset) Ordinalize(str string) string { return fmt.Sprintf("%dth", number) } +//ForeignKeyToAttribute returns the attribute name from the foreign key func (rs *Ruleset) ForeignKeyToAttribute(str string) string { w := rs.Camelize(str) if strings.HasSuffix(w, "Id") { @@ -620,6 +647,7 @@ func (rs *Ruleset) ForeignKeyToAttribute(str string) string { return w } +//LoadReader loads rules from io.Reader param func (rs *Ruleset) LoadReader(r io.Reader) error { m := map[string]string{} err := json.NewDecoder(r).Decode(&m) @@ -638,6 +666,7 @@ func (rs *Ruleset) LoadReader(r io.Reader) error { var defaultRuleset *Ruleset +//LoadReader loads rules from io.Reader param func LoadReader(r io.Reader) error { return defaultRuleset.LoadReader(r) } @@ -662,18 +691,22 @@ func init() { } } +//Uncountables returns a list of uncountables rules func Uncountables() map[string]bool { return defaultRuleset.Uncountables() } +//AddPlural adds plural to the ruleset func AddPlural(suffix, replacement string) { defaultRuleset.AddPlural(suffix, replacement) } +//AddSingular adds singular to the ruleset func AddSingular(suffix, replacement string) { defaultRuleset.AddSingular(suffix, replacement) } +//AddHuman adds human func AddHuman(suffix, replacement string) { defaultRuleset.AddHuman(suffix, replacement) } diff --git a/cmd/vendor/github.com/markbates/inflect/name.go b/cmd/vendor/github.com/markbates/inflect/name.go index 0345e352a9..5c3ca2698e 100644 --- a/cmd/vendor/github.com/markbates/inflect/name.go +++ b/cmd/vendor/github.com/markbates/inflect/name.go @@ -38,7 +38,12 @@ func (n Name) Singular() string { // Camel version of a name func (n Name) Camel() string { - return Camelize(string(n)) + c := Camelize(string(n)) + if strings.HasSuffix(c, "Id") { + c = strings.TrimSuffix(c, "Id") + c += "ID" + } + return c } // Model version of a name. ie. "user" => "User" @@ -72,7 +77,7 @@ func (n Name) Resource() string { // ModelPlural version of a name. ie. "user" => "Users" func (n Name) ModelPlural() string { - return Pluralize(n.Model()) + return Camelize(Pluralize(n.Model())) } // File version of a name @@ -130,6 +135,7 @@ func (n Name) ParamID() string { return fmt.Sprintf("%s_id", strings.Replace(n.UnderSingular(), "/", "_", -1)) } +// Package returns go package func (n Name) Package() string { key := string(n) @@ -143,6 +149,11 @@ func (n Name) Package() string { return key } +// Char returns first character in lower case, this is useful for methods inside a struct. func (n Name) Char() string { return strings.ToLower(string(n[0])) } + +func (n Name) String() string { + return string(n) +} diff --git a/cmd/vendor/github.com/mitchellh/go-homedir/LICENSE b/cmd/vendor/github.com/mitchellh/go-homedir/LICENSE deleted file mode 100644 index f9c841a51e..0000000000 --- a/cmd/vendor/github.com/mitchellh/go-homedir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/cmd/vendor/github.com/mitchellh/go-homedir/homedir.go b/cmd/vendor/github.com/mitchellh/go-homedir/homedir.go deleted file mode 100644 index 47e1f9ef8e..0000000000 --- a/cmd/vendor/github.com/mitchellh/go-homedir/homedir.go +++ /dev/null @@ -1,137 +0,0 @@ -package homedir - -import ( - "bytes" - "errors" - "os" - "os/exec" - "path/filepath" - "runtime" - "strconv" - "strings" - "sync" -) - -// DisableCache will disable caching of the home directory. Caching is enabled -// by default. -var DisableCache bool - -var homedirCache string -var cacheLock sync.RWMutex - -// Dir returns the home directory for the executing user. -// -// This uses an OS-specific method for discovering the home directory. -// An error is returned if a home directory cannot be detected. -func Dir() (string, error) { - if !DisableCache { - cacheLock.RLock() - cached := homedirCache - cacheLock.RUnlock() - if cached != "" { - return cached, nil - } - } - - cacheLock.Lock() - defer cacheLock.Unlock() - - var result string - var err error - if runtime.GOOS == "windows" { - result, err = dirWindows() - } else { - // Unix-like system, so just assume Unix - result, err = dirUnix() - } - - if err != nil { - return "", err - } - homedirCache = result - return result, nil -} - -// Expand expands the path to include the home directory if the path -// is prefixed with `~`. If it isn't prefixed with `~`, the path is -// returned as-is. -func Expand(path string) (string, error) { - if len(path) == 0 { - return path, nil - } - - if path[0] != '~' { - return path, nil - } - - if len(path) > 1 && path[1] != '/' && path[1] != '\\' { - return "", errors.New("cannot expand user-specific home dir") - } - - dir, err := Dir() - if err != nil { - return "", err - } - - return filepath.Join(dir, path[1:]), nil -} - -func dirUnix() (string, error) { - // First prefer the HOME environmental variable - if home := os.Getenv("HOME"); home != "" { - return home, nil - } - - // If that fails, try getent - var stdout bytes.Buffer - cmd := exec.Command("getent", "passwd", strconv.Itoa(os.Getuid())) - cmd.Stdout = &stdout - if err := cmd.Run(); err != nil { - // If the error is ErrNotFound, we ignore it. Otherwise, return it. - if err != exec.ErrNotFound { - return "", err - } - } else { - if passwd := strings.TrimSpace(stdout.String()); passwd != "" { - // username:password:uid:gid:gecos:home:shell - passwdParts := strings.SplitN(passwd, ":", 7) - if len(passwdParts) > 5 { - return passwdParts[5], nil - } - } - } - - // If all else fails, try the shell - stdout.Reset() - cmd = exec.Command("sh", "-c", "cd && pwd") - cmd.Stdout = &stdout - if err := cmd.Run(); err != nil { - return "", err - } - - result := strings.TrimSpace(stdout.String()) - if result == "" { - return "", errors.New("blank output when reading home directory") - } - - return result, nil -} - -func dirWindows() (string, error) { - // First prefer the HOME environmental variable - if home := os.Getenv("HOME"); home != "" { - return home, nil - } - - drive := os.Getenv("HOMEDRIVE") - path := os.Getenv("HOMEPATH") - home := drive + path - if drive == "" || path == "" { - home = os.Getenv("USERPROFILE") - } - if home == "" { - return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank") - } - - return home, nil -} diff --git a/cmd/vendor/github.com/spf13/pflag/bytes.go b/cmd/vendor/github.com/spf13/pflag/bytes.go new file mode 100644 index 0000000000..12c58db9fe --- /dev/null +++ b/cmd/vendor/github.com/spf13/pflag/bytes.go @@ -0,0 +1,105 @@ +package pflag + +import ( + "encoding/hex" + "fmt" + "strings" +) + +// BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded +type bytesHexValue []byte + +func (bytesHex bytesHexValue) String() string { + return fmt.Sprintf("%X", []byte(bytesHex)) +} + +func (bytesHex *bytesHexValue) Set(value string) error { + bin, err := hex.DecodeString(strings.TrimSpace(value)) + + if err != nil { + return err + } + + *bytesHex = bin + + return nil +} + +func (*bytesHexValue) Type() string { + return "bytesHex" +} + +func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue { + *p = val + return (*bytesHexValue)(p) +} + +func bytesHexConv(sval string) (interface{}, error) { + + bin, err := hex.DecodeString(sval) + + if err == nil { + return bin, nil + } + + return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err) +} + +// GetBytesHex return the []byte value of a flag with the given name +func (f *FlagSet) GetBytesHex(name string) ([]byte, error) { + val, err := f.getFlagType(name, "bytesHex", bytesHexConv) + + if err != nil { + return []byte{}, err + } + + return val.([]byte), nil +} + +// BytesHexVar defines an []byte flag with specified name, default value, and usage string. +// The argument p points to an []byte variable in which to store the value of the flag. +func (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) { + f.VarP(newBytesHexValue(value, p), name, "", usage) +} + +// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { + f.VarP(newBytesHexValue(value, p), name, shorthand, usage) +} + +// BytesHexVar defines an []byte flag with specified name, default value, and usage string. +// The argument p points to an []byte variable in which to store the value of the flag. +func BytesHexVar(p *[]byte, name string, value []byte, usage string) { + CommandLine.VarP(newBytesHexValue(value, p), name, "", usage) +} + +// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. +func BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { + CommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage) +} + +// BytesHex defines an []byte flag with specified name, default value, and usage string. +// The return value is the address of an []byte variable that stores the value of the flag. +func (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte { + p := new([]byte) + f.BytesHexVarP(p, name, "", value, usage) + return p +} + +// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { + p := new([]byte) + f.BytesHexVarP(p, name, shorthand, value, usage) + return p +} + +// BytesHex defines an []byte flag with specified name, default value, and usage string. +// The return value is the address of an []byte variable that stores the value of the flag. +func BytesHex(name string, value []byte, usage string) *[]byte { + return CommandLine.BytesHexP(name, "", value, usage) +} + +// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. +func BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { + return CommandLine.BytesHexP(name, shorthand, value, usage) +} diff --git a/cmd/vendor/github.com/spf13/pflag/count.go b/cmd/vendor/github.com/spf13/pflag/count.go index 250a43814c..aa126e44d1 100644 --- a/cmd/vendor/github.com/spf13/pflag/count.go +++ b/cmd/vendor/github.com/spf13/pflag/count.go @@ -11,13 +11,13 @@ func newCountValue(val int, p *int) *countValue { } 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 { + // "+1" means that no specific value was passed, so increment + if s == "+1" { *i = countValue(*i + 1) - } else { - *i = countValue(v) + return nil } + v, err := strconv.ParseInt(s, 0, 0) + *i = countValue(v) return err } @@ -54,7 +54,7 @@ func (f *FlagSet) CountVar(p *int, name string, usage string) { // 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" + flag.NoOptDefVal = "+1" } // CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set diff --git a/cmd/vendor/github.com/spf13/pflag/duration_slice.go b/cmd/vendor/github.com/spf13/pflag/duration_slice.go new file mode 100644 index 0000000000..52c6b6dc10 --- /dev/null +++ b/cmd/vendor/github.com/spf13/pflag/duration_slice.go @@ -0,0 +1,128 @@ +package pflag + +import ( + "fmt" + "strings" + "time" +) + +// -- durationSlice Value +type durationSliceValue struct { + value *[]time.Duration + changed bool +} + +func newDurationSliceValue(val []time.Duration, p *[]time.Duration) *durationSliceValue { + dsv := new(durationSliceValue) + dsv.value = p + *dsv.value = val + return dsv +} + +func (s *durationSliceValue) Set(val string) error { + ss := strings.Split(val, ",") + out := make([]time.Duration, len(ss)) + for i, d := range ss { + var err error + out[i], err = time.ParseDuration(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 *durationSliceValue) Type() string { + return "durationSlice" +} + +func (s *durationSliceValue) String() string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = fmt.Sprintf("%s", d) + } + return "[" + strings.Join(out, ",") + "]" +} + +func durationSliceConv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []time.Duration{}, nil + } + ss := strings.Split(val, ",") + out := make([]time.Duration, len(ss)) + for i, d := range ss { + var err error + out[i], err = time.ParseDuration(d) + if err != nil { + return nil, err + } + + } + return out, nil +} + +// GetDurationSlice returns the []time.Duration value of a flag with the given name +func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) { + val, err := f.getFlagType(name, "durationSlice", durationSliceConv) + if err != nil { + return []time.Duration{}, err + } + return val.([]time.Duration), nil +} + +// DurationSliceVar defines a durationSlice 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) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { + f.VarP(newDurationSliceValue(value, p), name, "", usage) +} + +// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { + f.VarP(newDurationSliceValue(value, p), name, shorthand, usage) +} + +// DurationSliceVar defines a duration[] flag with specified name, default value, and usage string. +// The argument p points to a duration[] variable in which to store the value of the flag. +func DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { + CommandLine.VarP(newDurationSliceValue(value, p), name, "", usage) +} + +// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. +func DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { + CommandLine.VarP(newDurationSliceValue(value, p), name, shorthand, usage) +} + +// DurationSlice 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) DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { + p := []time.Duration{} + f.DurationSliceVarP(&p, name, "", value, usage) + return &p +} + +// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { + p := []time.Duration{} + f.DurationSliceVarP(&p, name, shorthand, value, usage) + return &p +} + +// DurationSlice 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 DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { + return CommandLine.DurationSliceP(name, "", value, usage) +} + +// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. +func DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { + return CommandLine.DurationSliceP(name, shorthand, value, usage) +} diff --git a/cmd/vendor/github.com/spf13/pflag/flag.go b/cmd/vendor/github.com/spf13/pflag/flag.go index 6f1fc3007a..5eadc84e3c 100644 --- a/cmd/vendor/github.com/spf13/pflag/flag.go +++ b/cmd/vendor/github.com/spf13/pflag/flag.go @@ -101,6 +101,7 @@ package pflag import ( "bytes" "errors" + goflag "flag" "fmt" "io" "os" @@ -123,6 +124,12 @@ const ( PanicOnError ) +// ParseErrorsWhitelist defines the parsing errors that can be ignored +type ParseErrorsWhitelist struct { + // UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags + UnknownFlags bool +} + // NormalizedName is a flag name that has been normalized according to rules // for the FlagSet (e.g. making '-' and '_' equivalent). type NormalizedName string @@ -138,6 +145,9 @@ type FlagSet struct { // help/usage messages. SortFlags bool + // ParseErrorsWhitelist is used to configure a whitelist of errors + ParseErrorsWhitelist ParseErrorsWhitelist + name string parsed bool actual map[NormalizedName]*Flag @@ -153,6 +163,8 @@ type FlagSet struct { output io.Writer // nil means stderr; use out() accessor interspersed bool // allow interspersed option/non-option args normalizeNameFunc func(f *FlagSet, name string) NormalizedName + + addedGoFlagSets []*goflag.FlagSet } // A Flag represents the state of a flag. @@ -202,12 +214,18 @@ func sortFlags(flags map[NormalizedName]*Flag) []*Flag { 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 + for fname, flag := range f.formal { + nname := f.normalizeFlagName(flag.Name) + if fname == nname { + continue + } + flag.Name = string(nname) + delete(f.formal, fname) + f.formal[nname] = flag + if _, set := f.actual[fname]; set { + delete(f.actual, fname) + f.actual[nname] = flag + } } } @@ -261,16 +279,16 @@ func (f *FlagSet) VisitAll(fn func(*Flag)) { } } -// HasFlags returns a bool to indicate if the FlagSet has any flags definied. +// HasFlags returns a bool to indicate if the FlagSet has any flags defined. 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. +// that are not hidden. func (f *FlagSet) HasAvailableFlags() bool { for _, flag := range f.formal { - if !flag.Hidden && len(flag.Deprecated) == 0 { + if !flag.Hidden { return true } } @@ -380,6 +398,7 @@ func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.Deprecated = usageMessage + flag.Hidden = true return nil } @@ -440,13 +459,15 @@ func (f *FlagSet) Set(name, value string) error { 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) + if !flag.Changed { + if f.actual == nil { + f.actual = make(map[NormalizedName]*Flag) + } + f.actual[normalName] = flag + f.orderedActual = append(f.orderedActual, flag) - flag.Changed = true + flag.Changed = true + } if flag.Deprecated != "" { fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) @@ -556,6 +577,14 @@ func UnquoteUsage(flag *Flag) (name string, usage string) { name = "int" case "uint64": name = "uint" + case "stringSlice": + name = "strings" + case "intSlice": + name = "ints" + case "uintSlice": + name = "uints" + case "boolSlice": + name = "bools" } return @@ -570,11 +599,14 @@ func wrapN(i, slop int, s string) (string, string) { return s, "" } - w := strings.LastIndexAny(s[:i], " \t") + w := strings.LastIndexAny(s[:i], " \t\n") if w <= 0 { return s, "" } - + nlPos := strings.LastIndex(s[:i], "\n") + if nlPos > 0 && nlPos < w { + return s[:nlPos], s[nlPos+1:] + } return s[:w], s[w+1:] } @@ -583,7 +615,7 @@ func wrapN(i, slop int, s string) (string, string) { // caller). Pass `w` == 0 to do no wrapping func wrap(i, w int, s string) string { if w == 0 { - return s + return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1) } // space between indent i and end of line width w into which @@ -601,7 +633,7 @@ func wrap(i, w int, s string) string { } // If still not enough space then don't even try to wrap. if wrap < 24 { - return s + return strings.Replace(s, "\n", r, -1) } // Try to avoid short orphan words on the final line, by @@ -613,14 +645,14 @@ func wrap(i, w int, s string) string { // Handle first line, which is indented by the caller (or the // special case above) l, s = wrapN(wrap, slop, s) - r = r + l + r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1) // Now wrap the rest for s != "" { var t string t, s = wrapN(wrap, slop, s) - r = r + "\n" + strings.Repeat(" ", i) + t + r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1) } return r @@ -637,7 +669,7 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string { maxlen := 0 f.VisitAll(func(flag *Flag) { - if flag.Deprecated != "" || flag.Hidden { + if flag.Hidden { return } @@ -660,6 +692,10 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string { if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } + case "count": + if flag.NoOptDefVal != "+1" { + line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) + } default: line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } @@ -680,6 +716,9 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string { line += fmt.Sprintf(" (default %s)", flag.DefValue) } } + if len(flag.Deprecated) != 0 { + line += fmt.Sprintf(" (DEPRECATED: %s)", flag.Deprecated) + } lines = append(lines, line) }) @@ -857,8 +896,10 @@ func VarP(value Value, name, shorthand, usage string) { // returns the error. func (f *FlagSet) failf(format string, a ...interface{}) error { err := fmt.Errorf(format, a...) - fmt.Fprintln(f.out(), err) - f.usage() + if f.errorHandling != ContinueOnError { + fmt.Fprintln(f.out(), err) + f.usage() + } return err } @@ -874,6 +915,25 @@ func (f *FlagSet) usage() { } } +//--unknown (args will be empty) +//--unknown --next-flag ... (args will be --next-flag ...) +//--unknown arg ... (args will be arg ...) +func stripUnknownFlagValue(args []string) []string { + if len(args) == 0 { + //--unknown + return args + } + + first := args[0] + if first[0] == '-' { + //--unknown --next-flag ... + return args + } + + //--unknown arg ... (args will be arg ...) + return args[1:] +} + func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args name := s[2:] @@ -885,13 +945,24 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin 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. + switch { + case name == "help": f.usage() return a, ErrHelp + case f.ParseErrorsWhitelist.UnknownFlags: + // --unknown=unknownval arg ... + // we do not want to lose arg in this case + if len(split) >= 2 { + return a, nil + } + + return stripUnknownFlagValue(a), nil + default: + err = f.failf("unknown flag: --%s", name) + return } - err = f.failf("unknown flag: --%s", name) - return } var value string @@ -912,6 +983,9 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin } err = fn(flag, value) + if err != nil { + f.failf(err.Error()) + } return } @@ -926,13 +1000,25 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse flag, exists := f.shorthands[c] if !exists { - if c == 'h' { // special case for nice help message. + switch { + case c == 'h': f.usage() err = ErrHelp return + case f.ParseErrorsWhitelist.UnknownFlags: + // '-f=arg arg ...' + // we do not want to lose arg in this case + if len(shorthands) > 2 && shorthands[1] == '=' { + outShorts = "" + return + } + + outArgs = stripUnknownFlagValue(outArgs) + return + default: + err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) + return } - err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) - return } var value string @@ -962,6 +1048,9 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse } err = fn(flag, value) + if err != nil { + f.failf(err.Error()) + } return } @@ -1016,6 +1105,11 @@ func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) { // 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 { + if f.addedGoFlagSets != nil { + for _, goFlagSet := range f.addedGoFlagSets { + goFlagSet.Parse(nil) + } + } f.parsed = true if len(arguments) < 0 { @@ -1034,6 +1128,7 @@ func (f *FlagSet) Parse(arguments []string) error { case ContinueOnError: return err case ExitOnError: + fmt.Println(err) os.Exit(2) case PanicOnError: panic(err) diff --git a/cmd/vendor/github.com/spf13/pflag/golangflag.go b/cmd/vendor/github.com/spf13/pflag/golangflag.go index c4f47ebe59..d3dd72b7fe 100644 --- a/cmd/vendor/github.com/spf13/pflag/golangflag.go +++ b/cmd/vendor/github.com/spf13/pflag/golangflag.go @@ -98,4 +98,8 @@ func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { newSet.VisitAll(func(goflag *goflag.Flag) { f.AddGoFlag(goflag) }) + if f.addedGoFlagSets == nil { + f.addedGoFlagSets = make([]*goflag.FlagSet, 0) + } + f.addedGoFlagSets = append(f.addedGoFlagSets, newSet) } diff --git a/cmd/vendor/github.com/spf13/pflag/int16.go b/cmd/vendor/github.com/spf13/pflag/int16.go new file mode 100644 index 0000000000..f1a01d05e6 --- /dev/null +++ b/cmd/vendor/github.com/spf13/pflag/int16.go @@ -0,0 +1,88 @@ +package pflag + +import "strconv" + +// -- int16 Value +type int16Value int16 + +func newInt16Value(val int16, p *int16) *int16Value { + *p = val + return (*int16Value)(p) +} + +func (i *int16Value) Set(s string) error { + v, err := strconv.ParseInt(s, 0, 16) + *i = int16Value(v) + return err +} + +func (i *int16Value) Type() string { + return "int16" +} + +func (i *int16Value) String() string { return strconv.FormatInt(int64(*i), 10) } + +func int16Conv(sval string) (interface{}, error) { + v, err := strconv.ParseInt(sval, 0, 16) + if err != nil { + return 0, err + } + return int16(v), nil +} + +// GetInt16 returns the int16 value of a flag with the given name +func (f *FlagSet) GetInt16(name string) (int16, error) { + val, err := f.getFlagType(name, "int16", int16Conv) + if err != nil { + return 0, err + } + return val.(int16), nil +} + +// Int16Var defines an int16 flag with specified name, default value, and usage string. +// The argument p points to an int16 variable in which to store the value of the flag. +func (f *FlagSet) Int16Var(p *int16, name string, value int16, usage string) { + f.VarP(newInt16Value(value, p), name, "", usage) +} + +// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int16VarP(p *int16, name, shorthand string, value int16, usage string) { + f.VarP(newInt16Value(value, p), name, shorthand, usage) +} + +// Int16Var defines an int16 flag with specified name, default value, and usage string. +// The argument p points to an int16 variable in which to store the value of the flag. +func Int16Var(p *int16, name string, value int16, usage string) { + CommandLine.VarP(newInt16Value(value, p), name, "", usage) +} + +// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. +func Int16VarP(p *int16, name, shorthand string, value int16, usage string) { + CommandLine.VarP(newInt16Value(value, p), name, shorthand, usage) +} + +// Int16 defines an int16 flag with specified name, default value, and usage string. +// The return value is the address of an int16 variable that stores the value of the flag. +func (f *FlagSet) Int16(name string, value int16, usage string) *int16 { + p := new(int16) + f.Int16VarP(p, name, "", value, usage) + return p +} + +// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int16P(name, shorthand string, value int16, usage string) *int16 { + p := new(int16) + f.Int16VarP(p, name, shorthand, value, usage) + return p +} + +// Int16 defines an int16 flag with specified name, default value, and usage string. +// The return value is the address of an int16 variable that stores the value of the flag. +func Int16(name string, value int16, usage string) *int16 { + return CommandLine.Int16P(name, "", value, usage) +} + +// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. +func Int16P(name, shorthand string, value int16, usage string) *int16 { + return CommandLine.Int16P(name, shorthand, value, usage) +} diff --git a/cmd/vendor/github.com/spf13/pflag/string_array.go b/cmd/vendor/github.com/spf13/pflag/string_array.go index 276b7ed49e..fa7bc60187 100644 --- a/cmd/vendor/github.com/spf13/pflag/string_array.go +++ b/cmd/vendor/github.com/spf13/pflag/string_array.go @@ -52,7 +52,7 @@ func (f *FlagSet) GetStringArray(name string) ([]string, error) { // 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 +// The value of each argument will not try to be separated by comma. Use a StringSlice for that. func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, "", usage) } @@ -64,7 +64,7 @@ func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []s // 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 +// The value of each argument will not try to be separated by comma. Use a StringSlice for that. func StringArrayVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, "", usage) } @@ -76,7 +76,7 @@ func StringArrayVarP(p *[]string, name, shorthand string, value []string, 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 +// The value of each argument will not try to be separated by comma. Use a StringSlice for that. func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, "", value, usage) @@ -92,7 +92,7 @@ func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage str // 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 +// The value of each argument will not try to be separated by comma. Use a StringSlice for that. func StringArray(name string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, "", value, usage) } diff --git a/cmd/vendor/github.com/spf13/pflag/string_slice.go b/cmd/vendor/github.com/spf13/pflag/string_slice.go index 05eee75438..0cd3ccc083 100644 --- a/cmd/vendor/github.com/spf13/pflag/string_slice.go +++ b/cmd/vendor/github.com/spf13/pflag/string_slice.go @@ -82,6 +82,11 @@ func (f *FlagSet) GetStringSlice(name string) ([]string, error) { // 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. +// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. +// For example: +// --ss="v1,v2" -ss="v3" +// will result in +// []string{"v1", "v2", "v3"} func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringSliceValue(value, p), name, "", usage) } @@ -93,6 +98,11 @@ func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []s // 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. +// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. +// For example: +// --ss="v1,v2" -ss="v3" +// will result in +// []string{"v1", "v2", "v3"} func StringSliceVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringSliceValue(value, p), name, "", usage) } @@ -104,6 +114,11 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, 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. +// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. +// For example: +// --ss="v1,v2" -ss="v3" +// will result in +// []string{"v1", "v2", "v3"} func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { p := []string{} f.StringSliceVarP(&p, name, "", value, usage) @@ -119,6 +134,11 @@ func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage str // 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. +// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. +// For example: +// --ss="v1,v2" -ss="v3" +// will result in +// []string{"v1", "v2", "v3"} func StringSlice(name string, value []string, usage string) *[]string { return CommandLine.StringSliceP(name, "", value, usage) } diff --git a/cmd/vendor/golang.org/x/net/dns/dnsmessage/message.go b/cmd/vendor/golang.org/x/net/dns/dnsmessage/message.go index e98fda66ee..38f81774e6 100644 --- a/cmd/vendor/golang.org/x/net/dns/dnsmessage/message.go +++ b/cmd/vendor/golang.org/x/net/dns/dnsmessage/message.go @@ -5,6 +5,9 @@ // Package dnsmessage provides a mostly RFC 1035 compliant implementation of // DNS message packing and unpacking. // +// The package also supports messages with Extension Mechanisms for DNS +// (EDNS(0)) as defined in RFC 6891. +// // This implementation is designed to minimize heap allocations and avoid // unnecessary packing and unpacking as much as possible. package dnsmessage @@ -39,6 +42,7 @@ const ( TypeTXT Type = 16 TypeAAAA Type = 28 TypeSRV Type = 33 + TypeOPT Type = 41 // Question.Type TypeWKS Type = 11 @@ -90,6 +94,8 @@ var ( errTooManyAuthorities = errors.New("too many Authorities to pack (>65535)") errTooManyAdditionals = errors.New("too many Additionals to pack (>65535)") errNonCanonicalName = errors.New("name is not in canonical format (it must end with a .)") + errStringTooLong = errors.New("character string exceeds maximum length (255)") + errCompressedSRV = errors.New("compressed name in SRV resource data") ) // Internal constants. @@ -218,6 +224,7 @@ func (h *header) count(sec section) uint16 { return 0 } +// pack appends the wire format of the header to msg. func (h *header) pack(msg []byte) []byte { msg = packUint16(msg, h.id) msg = packUint16(msg, h.bits) @@ -273,25 +280,26 @@ type Resource struct { // A ResourceBody is a DNS resource record minus the header. type ResourceBody interface { // pack packs a Resource except for its header. - pack(msg []byte, compression map[string]int) ([]byte, error) + pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) // realType returns the actual type of the Resource. This is used to // fill in the header Type field. realType() Type } -func (r *Resource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the Resource to msg. +func (r *Resource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { if r.Body == nil { return msg, errNilResouceBody } oldMsg := msg r.Header.Type = r.Body.realType() - msg, length, err := r.Header.pack(msg, compression) + msg, length, err := r.Header.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"ResourceHeader", err} } preLen := len(msg) - msg, err = r.Body.pack(msg, compression) + msg, err = r.Body.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"content", err} } @@ -798,6 +806,24 @@ func (p *Parser) AAAAResource() (AAAAResource, error) { return r, nil } +// OPTResource parses a single OPTResource. +// +// One of the XXXHeader methods must have been called before calling this +// method. +func (p *Parser) OPTResource() (OPTResource, error) { + if !p.resHeaderValid || p.resHeader.Type != TypeOPT { + return OPTResource{}, ErrNotStarted + } + r, err := unpackOPTResource(p.msg, p.off, p.resHeader.Length) + if err != nil { + return OPTResource{}, err + } + p.off += int(p.resHeader.Length) + p.resHeaderValid = false + p.index++ + return r, nil +} + // Unpack parses a full Message. func (m *Message) Unpack(msg []byte) error { var p Parser @@ -852,6 +878,7 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { h.authorities = uint16(len(m.Authorities)) h.additionals = uint16(len(m.Additionals)) + compressionOff := len(b) msg := h.pack(b) // RFC 1035 allows (but does not require) compression for packing. RFC @@ -866,25 +893,25 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { for i := range m.Questions { var err error - if msg, err = m.Questions[i].pack(msg, compression); err != nil { + if msg, err = m.Questions[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Question", err} } } for i := range m.Answers { var err error - if msg, err = m.Answers[i].pack(msg, compression); err != nil { + if msg, err = m.Answers[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Answer", err} } } for i := range m.Authorities { var err error - if msg, err = m.Authorities[i].pack(msg, compression); err != nil { + if msg, err = m.Authorities[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Authority", err} } } for i := range m.Additionals { var err error - if msg, err = m.Additionals[i].pack(msg, compression); err != nil { + if msg, err = m.Additionals[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Additional", err} } } @@ -893,36 +920,69 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { } // A Builder allows incrementally packing a DNS message. +// +// Example usage: +// buf := make([]byte, 2, 514) +// b := NewBuilder(buf, Header{...}) +// b.EnableCompression() +// // Optionally start a section and add things to that section. +// // Repeat adding sections as necessary. +// buf, err := b.Finish() +// // If err is nil, buf[2:] will contain the built bytes. type Builder struct { - msg []byte - header header - section section + // msg is the storage for the message being built. + msg []byte + + // section keeps track of the current section being built. + section section + + // header keeps track of what should go in the header when Finish is + // called. + header header + + // start is the starting index of the bytes allocated in msg for header. + start int + + // compression is a mapping from name suffixes to their starting index + // in msg. compression map[string]int } -// Start initializes the builder. +// NewBuilder creates a new builder with compression disabled. // -// buf is optional (nil is fine), but if provided, Start takes ownership of buf. -func (b *Builder) Start(buf []byte, h Header) { - b.StartWithoutCompression(buf, h) - b.compression = map[string]int{} +// Note: Most users will want to immediately enable compression with the +// EnableCompression method. See that method's comment for why you may or may +// not want to enable compression. +// +// The DNS message is appended to the provided initial buffer buf (which may be +// nil) as it is built. The final message is returned by the (*Builder).Finish +// method, which may return the same underlying array if there was sufficient +// capacity in the slice. +func NewBuilder(buf []byte, h Header) Builder { + if buf == nil { + buf = make([]byte, 0, packStartingCap) + } + b := Builder{msg: buf, start: len(buf)} + b.header.id, b.header.bits = h.pack() + var hb [headerLen]byte + b.msg = append(b.msg, hb[:]...) + b.section = sectionHeader + return b } -// StartWithoutCompression initializes the builder with compression disabled. +// EnableCompression enables compression in the Builder. // -// This avoids compression related allocations, but can result in larger message -// sizes. Be careful with this mode as it can cause messages to exceed the UDP -// size limit. +// Leaving compression disabled avoids compression related allocations, but can +// result in larger message sizes. Be careful with this mode as it can cause +// messages to exceed the UDP size limit. // -// buf is optional (nil is fine), but if provided, Start takes ownership of buf. -func (b *Builder) StartWithoutCompression(buf []byte, h Header) { - *b = Builder{msg: buf} - b.header.id, b.header.bits = h.pack() - if cap(b.msg) < headerLen { - b.msg = make([]byte, 0, packStartingCap) - } - b.msg = b.msg[:headerLen] - b.section = sectionHeader +// According to RFC 1035, section 4.1.4, the use of compression is optional, but +// all implementations must accept both compressed and uncompressed DNS +// messages. +// +// Compression should be enabled before any sections are added for best results. +func (b *Builder) EnableCompression() { + b.compression = map[string]int{} } func (b *Builder) startCheck(s section) error { @@ -1003,7 +1063,7 @@ func (b *Builder) Question(q Question) error { if b.section > sectionQuestions { return ErrSectionDone } - msg, err := q.pack(b.msg, b.compression) + msg, err := q.pack(b.msg, b.compression, b.start) if err != nil { return err } @@ -1030,12 +1090,12 @@ func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"CNAMEResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1054,12 +1114,12 @@ func (b *Builder) MXResource(h ResourceHeader, r MXResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"MXResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1078,12 +1138,12 @@ func (b *Builder) NSResource(h ResourceHeader, r NSResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"NSResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1102,12 +1162,12 @@ func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"PTRResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1126,12 +1186,12 @@ func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"SOAResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1150,12 +1210,12 @@ func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"TXTResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1174,12 +1234,12 @@ func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"SRVResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1198,12 +1258,12 @@ func (b *Builder) AResource(h ResourceHeader, r AResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"AResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1222,12 +1282,12 @@ func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"AAAAResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1240,13 +1300,38 @@ func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { return nil } +// OPTResource adds a single OPTResource. +func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error { + if err := b.checkResourceSection(); err != nil { + return err + } + h.Type = r.realType() + msg, length, err := h.pack(b.msg, b.compression, b.start) + if err != nil { + return &nestedError{"ResourceHeader", err} + } + preLen := len(msg) + if msg, err = r.pack(msg, b.compression, b.start); err != nil { + return &nestedError{"OPTResource body", err} + } + if err := h.fixLen(msg, length, preLen); err != nil { + return err + } + if err := b.incrementSectionCount(); err != nil { + return err + } + b.msg = msg + return nil +} + // Finish ends message building and generates a binary message. func (b *Builder) Finish() ([]byte, error) { if b.section < sectionHeader { return nil, ErrNotStarted } b.section = sectionDone - b.header.pack(b.msg[:0]) + // Space for the header was allocated in NewBuilder. + b.header.pack(b.msg[b.start:b.start]) return b.msg, nil } @@ -1276,12 +1361,13 @@ type ResourceHeader struct { Length uint16 } -// pack packs all of the fields in a ResourceHeader except for the length. The -// length bytes are returned as a slice so they can be filled in after the rest -// of the Resource has been packed. -func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int) (msg []byte, length []byte, err error) { +// pack appends the wire format of the ResourceHeader to oldMsg. +// +// The bytes where length was packed are returned as a slice so they can be +// updated after the rest of the Resource has been packed. +func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int, compressionOff int) (msg []byte, length []byte, err error) { msg = oldMsg - if msg, err = h.Name.pack(msg, compression); err != nil { + if msg, err = h.Name.pack(msg, compression, compressionOff); err != nil { return oldMsg, nil, &nestedError{"Name", err} } msg = packType(msg, h.Type) @@ -1326,6 +1412,44 @@ func (h *ResourceHeader) fixLen(msg []byte, length []byte, preLen int) error { return nil } +// EDNS(0) wire costants. +const ( + edns0Version = 0 + + edns0DNSSECOK = 0x00008000 + ednsVersionMask = 0x00ff0000 + edns0DNSSECOKMask = 0x00ff8000 +) + +// SetEDNS0 configures h for EDNS(0). +// +// The provided extRCode must be an extedned RCode. +func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error { + h.Name = Name{Data: [nameLen]byte{'.'}, Length: 1} // RFC 6891 section 6.1.2 + h.Type = TypeOPT + h.Class = Class(udpPayloadLen) + h.TTL = uint32(extRCode) >> 4 << 24 + if dnssecOK { + h.TTL |= edns0DNSSECOK + } + return nil +} + +// DNSSECAllowed reports whether the DNSSEC OK bit is set. +func (h *ResourceHeader) DNSSECAllowed() bool { + return h.TTL&edns0DNSSECOKMask == edns0DNSSECOK // RFC 6891 section 6.1.3 +} + +// ExtendedRCode returns an extended RCode. +// +// The provided rcode must be the RCode in DNS message header. +func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode { + if h.TTL&ednsVersionMask == edns0Version { // RFC 6891 section 6.1.3 + return RCode(h.TTL>>24<<4) | rcode + } + return rcode +} + func skipResource(msg []byte, off int) (int, error) { newOff, err := skipName(msg, off) if err != nil { @@ -1350,6 +1474,7 @@ func skipResource(msg []byte, off int) (int, error) { return newOff, nil } +// packUint16 appends the wire format of field to msg. func packUint16(msg []byte, field uint16) []byte { return append(msg, byte(field>>8), byte(field)) } @@ -1368,6 +1493,7 @@ func skipUint16(msg []byte, off int) (int, error) { return off + uint16Len, nil } +// packType appends the wire format of field to msg. func packType(msg []byte, field Type) []byte { return packUint16(msg, uint16(field)) } @@ -1381,6 +1507,7 @@ func skipType(msg []byte, off int) (int, error) { return skipUint16(msg, off) } +// packClass appends the wire format of field to msg. func packClass(msg []byte, field Class) []byte { return packUint16(msg, uint16(field)) } @@ -1394,6 +1521,7 @@ func skipClass(msg []byte, off int) (int, error) { return skipUint16(msg, off) } +// packUint32 appends the wire format of field to msg. func packUint32(msg []byte, field uint32) []byte { return append( msg, @@ -1419,17 +1547,16 @@ func skipUint32(msg []byte, off int) (int, error) { return off + uint32Len, nil } -func packText(msg []byte, field string) []byte { - for len(field) > 0 { - l := len(field) - if l > 255 { - l = 255 - } - msg = append(msg, byte(l)) - msg = append(msg, field[:l]...) - field = field[l:] +// packText appends the wire format of field to msg. +func packText(msg []byte, field string) ([]byte, error) { + l := len(field) + if l > 255 { + return nil, errStringTooLong } - return msg + msg = append(msg, byte(l)) + msg = append(msg, field...) + + return msg, nil } func unpackText(msg []byte, off int) (string, int, error) { @@ -1455,6 +1582,7 @@ func skipText(msg []byte, off int) (int, error) { return endOff, nil } +// packBytes appends the wire format of field to msg. func packBytes(msg []byte, field []byte) []byte { return append(msg, field...) } @@ -1499,14 +1627,14 @@ func (n Name) String() string { return string(n.Data[:n.Length]) } -// pack packs a domain name. +// pack appends the wire format of the Name to msg. // // Domain names are a sequence of counted strings split at the dots. They end // with a zero-length string. Compression can be used to reuse domain suffixes. // // The compression map will be updated with new domain suffixes. If compression // is nil, compression will not be used. -func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { +func (n *Name) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg // Add a trailing dot to canonicalize name. @@ -1558,7 +1686,7 @@ func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { // Miss. Add the suffix to the compression table if the // offset can be stored in the available 14 bytes. if len(msg) <= int(^uint16(0)>>2) { - compression[string(n.Data[i:])] = len(msg) + compression[string(n.Data[i:])] = len(msg) - compressionOff } } } @@ -1567,6 +1695,10 @@ func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { // unpack unpacks a domain name. func (n *Name) unpack(msg []byte, off int) (int, error) { + return n.unpackCompressed(msg, off, true /* allowCompression */) +} + +func (n *Name) unpackCompressed(msg []byte, off int, allowCompression bool) (int, error) { // currOff is the current working offset. currOff := off @@ -1602,6 +1734,9 @@ Loop: name = append(name, '.') currOff = endOff case 0xC0: // Pointer + if !allowCompression { + return off, errCompressedSRV + } if currOff >= len(msg) { return off, errInvalidPtr } @@ -1681,8 +1816,9 @@ type Question struct { Class Class } -func (q *Question) pack(msg []byte, compression map[string]int) ([]byte, error) { - msg, err := q.Name.pack(msg, compression) +// pack appends the wire format of the Question to msg. +func (q *Question) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + msg, err := q.Name.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"Name", err} } @@ -1742,6 +1878,11 @@ func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody, rb, err = unpackSRVResource(msg, off) r = &rb name = "SRV" + case TypeOPT: + var rb OPTResource + rb, err = unpackOPTResource(msg, off, hdr.Length) + r = &rb + name = "OPT" } if err != nil { return nil, off, &nestedError{name + " record", err} @@ -1761,8 +1902,9 @@ func (r *CNAMEResource) realType() Type { return TypeCNAME } -func (r *CNAMEResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.CNAME.pack(msg, compression) +// pack appends the wire format of the CNAMEResource to msg. +func (r *CNAMEResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.CNAME.pack(msg, compression, compressionOff) } func unpackCNAMEResource(msg []byte, off int) (CNAMEResource, error) { @@ -1783,10 +1925,11 @@ func (r *MXResource) realType() Type { return TypeMX } -func (r *MXResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the MXResource to msg. +func (r *MXResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg msg = packUint16(msg, r.Pref) - msg, err := r.MX.pack(msg, compression) + msg, err := r.MX.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"MXResource.MX", err} } @@ -1814,8 +1957,9 @@ func (r *NSResource) realType() Type { return TypeNS } -func (r *NSResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.NS.pack(msg, compression) +// pack appends the wire format of the NSResource to msg. +func (r *NSResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.NS.pack(msg, compression, compressionOff) } func unpackNSResource(msg []byte, off int) (NSResource, error) { @@ -1835,8 +1979,9 @@ func (r *PTRResource) realType() Type { return TypePTR } -func (r *PTRResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.PTR.pack(msg, compression) +// pack appends the wire format of the PTRResource to msg. +func (r *PTRResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.PTR.pack(msg, compression, compressionOff) } func unpackPTRResource(msg []byte, off int) (PTRResource, error) { @@ -1866,13 +2011,14 @@ func (r *SOAResource) realType() Type { return TypeSOA } -func (r *SOAResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the SOAResource to msg. +func (r *SOAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg - msg, err := r.NS.pack(msg, compression) + msg, err := r.NS.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"SOAResource.NS", err} } - msg, err = r.MBox.pack(msg, compression) + msg, err = r.MBox.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"SOAResource.MBox", err} } @@ -1918,19 +2064,28 @@ func unpackSOAResource(msg []byte, off int) (SOAResource, error) { // A TXTResource is a TXT Resource record. type TXTResource struct { - Txt string // Not a domain name. + TXT []string } func (r *TXTResource) realType() Type { return TypeTXT } -func (r *TXTResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return packText(msg, r.Txt), nil +// pack appends the wire format of the TXTResource to msg. +func (r *TXTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + oldMsg := msg + for _, s := range r.TXT { + var err error + msg, err = packText(msg, s) + if err != nil { + return oldMsg, err + } + } + return msg, nil } func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) { - var txt string + txts := make([]string, 0, 1) for n := uint16(0); n < length; { var t string var err error @@ -1942,9 +2097,9 @@ func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) return TXTResource{}, errCalcLen } n += uint16(len(t)) + 1 - txt += t + txts = append(txts, t) } - return TXTResource{txt}, nil + return TXTResource{txts}, nil } // An SRVResource is an SRV Resource record. @@ -1959,12 +2114,13 @@ func (r *SRVResource) realType() Type { return TypeSRV } -func (r *SRVResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the SRVResource to msg. +func (r *SRVResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg msg = packUint16(msg, r.Priority) msg = packUint16(msg, r.Weight) msg = packUint16(msg, r.Port) - msg, err := r.Target.pack(msg, nil) + msg, err := r.Target.pack(msg, nil, compressionOff) if err != nil { return oldMsg, &nestedError{"SRVResource.Target", err} } @@ -1985,7 +2141,7 @@ func unpackSRVResource(msg []byte, off int) (SRVResource, error) { return SRVResource{}, &nestedError{"Port", err} } var target Name - if _, err := target.unpack(msg, off); err != nil { + if _, err := target.unpackCompressed(msg, off, false /* allowCompression */); err != nil { return SRVResource{}, &nestedError{"Target", err} } return SRVResource{priority, weight, port, target}, nil @@ -2000,7 +2156,8 @@ func (r *AResource) realType() Type { return TypeA } -func (r *AResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the AResource to msg. +func (r *AResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { return packBytes(msg, r.A[:]), nil } @@ -2021,7 +2178,8 @@ func (r *AAAAResource) realType() Type { return TypeAAAA } -func (r *AAAAResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the AAAAResource to msg. +func (r *AAAAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { return packBytes(msg, r.AAAA[:]), nil } @@ -2032,3 +2190,58 @@ func unpackAAAAResource(msg []byte, off int) (AAAAResource, error) { } return AAAAResource{aaaa}, nil } + +// An OPTResource is an OPT pseudo Resource record. +// +// The pseudo resource record is part of the extension mechanisms for DNS +// as defined in RFC 6891. +type OPTResource struct { + Options []Option +} + +// An Option represents a DNS message option within OPTResource. +// +// The message option is part of the extension mechanisms for DNS as +// defined in RFC 6891. +type Option struct { + Code uint16 // option code + Data []byte +} + +func (r *OPTResource) realType() Type { + return TypeOPT +} + +func (r *OPTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + for _, opt := range r.Options { + msg = packUint16(msg, opt.Code) + l := uint16(len(opt.Data)) + msg = packUint16(msg, l) + msg = packBytes(msg, opt.Data) + } + return msg, nil +} + +func unpackOPTResource(msg []byte, off int, length uint16) (OPTResource, error) { + var opts []Option + for oldOff := off; off < oldOff+int(length); { + var err error + var o Option + o.Code, off, err = unpackUint16(msg, off) + if err != nil { + return OPTResource{}, &nestedError{"Code", err} + } + var l uint16 + l, off, err = unpackUint16(msg, off) + if err != nil { + return OPTResource{}, &nestedError{"Data", err} + } + o.Data = make([]byte, l) + if copy(o.Data, msg[off:]) != int(l) { + return OPTResource{}, &nestedError{"Data", errCalcLen} + } + off += int(l) + opts = append(opts, o) + } + return OPTResource{opts}, nil +} diff --git a/cmd/vendor/golang.org/x/net/html/atom/gen.go b/cmd/vendor/golang.org/x/net/html/atom/gen.go index 56cd842514..5d052781bc 100644 --- a/cmd/vendor/golang.org/x/net/html/atom/gen.go +++ b/cmd/vendor/golang.org/x/net/html/atom/gen.go @@ -306,7 +306,7 @@ func (t *table) push(i uint32, depth int) bool { // The lists of element names and attribute keys were taken from // https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 18 September 2017" version. +// as of the "HTML Living Standard - Last Updated 16 April 2018" version. // "command", "keygen" and "menuitem" have been removed from the spec, // but are kept here for backwards compatibility. @@ -701,6 +701,8 @@ var extra = []string{ "plaintext", "prompt", "public", + "rb", + "rtc", "spacer", "strike", "svg", diff --git a/cmd/vendor/golang.org/x/net/html/atom/table.go b/cmd/vendor/golang.org/x/net/html/atom/table.go index a91bd6475c..2a938864cb 100644 --- a/cmd/vendor/golang.org/x/net/html/atom/table.go +++ b/cmd/vendor/golang.org/x/net/html/atom/table.go @@ -10,30 +10,30 @@ const ( Accept Atom = 0x1a06 AcceptCharset Atom = 0x1a0e Accesskey Atom = 0x2c09 - Acronym Atom = 0x6907 - Action Atom = 0x26a06 + Acronym Atom = 0xaa07 + Action Atom = 0x27206 Address Atom = 0x6f307 - Align Atom = 0x7005 - Allowfullscreen Atom = 0x2000f - Allowpaymentrequest Atom = 0x8013 - Allowusermedia Atom = 0x9c0e - Alt Atom = 0xc703 + Align Atom = 0xb105 + Allowfullscreen Atom = 0x2080f + Allowpaymentrequest Atom = 0xc113 + Allowusermedia Atom = 0xdd0e + Alt Atom = 0xf303 Annotation Atom = 0x1c90a AnnotationXml Atom = 0x1c90e - Applet Atom = 0x31106 - Area Atom = 0x34e04 - Article Atom = 0x3f407 - As Atom = 0xd002 - Aside Atom = 0xd805 - Async Atom = 0xd005 - Audio Atom = 0xe605 - Autocomplete Atom = 0x2700c - Autofocus Atom = 0x10209 - Autoplay Atom = 0x11d08 + Applet Atom = 0x31906 + Area Atom = 0x35604 + Article Atom = 0x3fc07 + As Atom = 0x3c02 + Aside Atom = 0x10705 + Async Atom = 0xff05 + Audio Atom = 0x11505 + Autocomplete Atom = 0x2780c + Autofocus Atom = 0x12109 + Autoplay Atom = 0x13c08 B Atom = 0x101 - Base Atom = 0x12c04 - Basefont Atom = 0x12c08 - Bdi Atom = 0x7903 + Base Atom = 0x3b04 + Basefont Atom = 0x3b08 + Bdi Atom = 0xba03 Bdo Atom = 0x14b03 Bgsound Atom = 0x15e07 Big Atom = 0x17003 @@ -42,217 +42,217 @@ const ( Body Atom = 0x2804 Br Atom = 0x202 Button Atom = 0x19106 - Canvas Atom = 0xd406 - Caption Atom = 0x22907 - Center Atom = 0x21806 - Challenge Atom = 0x29309 + Canvas Atom = 0x10306 + Caption Atom = 0x23107 + Center Atom = 0x22006 + Challenge Atom = 0x29b09 Charset Atom = 0x2107 - Checked Atom = 0x47107 - Cite Atom = 0x55c04 - Class Atom = 0x5bd05 - Code Atom = 0x1a004 - Col Atom = 0x1a703 - Colgroup Atom = 0x1a708 + Checked Atom = 0x47907 + Cite Atom = 0x19c04 + Class Atom = 0x56405 + Code Atom = 0x5c504 + Col Atom = 0x1ab03 + Colgroup Atom = 0x1ab08 Color Atom = 0x1bf05 Cols Atom = 0x1c404 Colspan Atom = 0x1c407 Command Atom = 0x1d707 - Content Atom = 0x58307 - Contenteditable Atom = 0x5830f - Contextmenu Atom = 0x3780b + Content Atom = 0x58b07 + Contenteditable Atom = 0x58b0f + Contextmenu Atom = 0x3800b Controls Atom = 0x1de08 Coords Atom = 0x1ea06 - Crossorigin Atom = 0x1f30b - Data Atom = 0x49d04 - Datalist Atom = 0x49d08 - Datetime Atom = 0x2b008 - Dd Atom = 0x2cf02 - Default Atom = 0xdb07 - Defer Atom = 0x1a205 - Del Atom = 0x44a03 - Desc Atom = 0x55904 - Details Atom = 0x4607 - Dfn Atom = 0x5f03 - Dialog Atom = 0x7a06 - Dir Atom = 0xba03 - Dirname Atom = 0xba07 + Crossorigin Atom = 0x1fb0b + Data Atom = 0x4a504 + Datalist Atom = 0x4a508 + Datetime Atom = 0x2b808 + Dd Atom = 0x2d702 + Default Atom = 0x10a07 + Defer Atom = 0x5c705 + Del Atom = 0x45203 + Desc Atom = 0x56104 + Details Atom = 0x7207 + Dfn Atom = 0x8703 + Dialog Atom = 0xbb06 + Dir Atom = 0x9303 + Dirname Atom = 0x9307 Disabled Atom = 0x16408 Div Atom = 0x16b03 Dl Atom = 0x5e602 - Download Atom = 0x45b08 + Download Atom = 0x46308 Draggable Atom = 0x17a09 - Dropzone Atom = 0x3fd08 + Dropzone Atom = 0x40508 Dt Atom = 0x64b02 - Em Atom = 0x4202 - Embed Atom = 0x4205 - Enctype Atom = 0x28507 - Face Atom = 0x21604 - Fieldset Atom = 0x21e08 - Figcaption Atom = 0x2260a - Figure Atom = 0x24006 - Font Atom = 0x13004 - Footer Atom = 0xca06 - For Atom = 0x24c03 - ForeignObject Atom = 0x24c0d - Foreignobject Atom = 0x2590d - Form Atom = 0x26604 - Formaction Atom = 0x2660a - Formenctype Atom = 0x2810b - Formmethod Atom = 0x29c0a - Formnovalidate Atom = 0x2a60e - Formtarget Atom = 0x2b80a - Frame Atom = 0x5705 - Frameset Atom = 0x5708 + Em Atom = 0x6e02 + Embed Atom = 0x6e05 + Enctype Atom = 0x28d07 + Face Atom = 0x21e04 + Fieldset Atom = 0x22608 + Figcaption Atom = 0x22e0a + Figure Atom = 0x24806 + Font Atom = 0x3f04 + Footer Atom = 0xf606 + For Atom = 0x25403 + ForeignObject Atom = 0x2540d + Foreignobject Atom = 0x2610d + Form Atom = 0x26e04 + Formaction Atom = 0x26e0a + Formenctype Atom = 0x2890b + Formmethod Atom = 0x2a40a + Formnovalidate Atom = 0x2ae0e + Formtarget Atom = 0x2c00a + Frame Atom = 0x8b05 + Frameset Atom = 0x8b08 H1 Atom = 0x15c02 - H2 Atom = 0x2d602 - H3 Atom = 0x30502 - H4 Atom = 0x33d02 - H5 Atom = 0x34702 + H2 Atom = 0x2de02 + H3 Atom = 0x30d02 + H4 Atom = 0x34502 + H5 Atom = 0x34f02 H6 Atom = 0x64d02 - Head Atom = 0x32904 - Header Atom = 0x32906 - Headers Atom = 0x32907 - Height Atom = 0x14306 - Hgroup Atom = 0x2c206 - Hidden Atom = 0x2cd06 - High Atom = 0x2d304 + Head Atom = 0x33104 + Header Atom = 0x33106 + Headers Atom = 0x33107 + Height Atom = 0x5206 + Hgroup Atom = 0x2ca06 + Hidden Atom = 0x2d506 + High Atom = 0x2db04 Hr Atom = 0x15702 - Href Atom = 0x2d804 - Hreflang Atom = 0x2d808 - Html Atom = 0x14704 - HttpEquiv Atom = 0x2e00a + Href Atom = 0x2e004 + Hreflang Atom = 0x2e008 + Html Atom = 0x5604 + HttpEquiv Atom = 0x2e80a I Atom = 0x601 - Icon Atom = 0x58204 - Id Atom = 0xda02 - Iframe Atom = 0x2f406 - Image Atom = 0x2fa05 - Img Atom = 0x2ff03 - Input Atom = 0x44305 - Inputmode Atom = 0x44309 - Ins Atom = 0x1fc03 - Integrity Atom = 0x23709 + Icon Atom = 0x58a04 + Id Atom = 0x10902 + Iframe Atom = 0x2fc06 + Image Atom = 0x30205 + Img Atom = 0x30703 + Input Atom = 0x44b05 + Inputmode Atom = 0x44b09 + Ins Atom = 0x20403 + Integrity Atom = 0x23f09 Is Atom = 0x16502 - Isindex Atom = 0x30707 - Ismap Atom = 0x30e05 - Itemid Atom = 0x38306 - Itemprop Atom = 0x55d08 - Itemref Atom = 0x3c507 + Isindex Atom = 0x30f07 + Ismap Atom = 0x31605 + Itemid Atom = 0x38b06 + Itemprop Atom = 0x19d08 + Itemref Atom = 0x3cd07 Itemscope Atom = 0x67109 - Itemtype Atom = 0x31708 - Kbd Atom = 0x7803 + Itemtype Atom = 0x31f08 + Kbd Atom = 0xb903 Keygen Atom = 0x3206 - Keytype Atom = 0x9507 + Keytype Atom = 0xd607 Kind Atom = 0x17704 - Label Atom = 0xf105 - Lang Atom = 0x2dc04 + Label Atom = 0x5905 + Lang Atom = 0x2e404 Legend Atom = 0x18106 - Li Atom = 0x7102 + Li Atom = 0xb202 Link Atom = 0x17404 - List Atom = 0x4a104 - Listing Atom = 0x4a107 - Loop Atom = 0xf504 - Low Atom = 0x8203 + List Atom = 0x4a904 + Listing Atom = 0x4a907 + Loop Atom = 0x5d04 + Low Atom = 0xc303 Main Atom = 0x1004 - Malignmark Atom = 0x6f0a + Malignmark Atom = 0xb00a Manifest Atom = 0x6d708 - Map Atom = 0x31003 - Mark Atom = 0x7504 - Marquee Atom = 0x31f07 - Math Atom = 0x32604 - Max Atom = 0x33503 - Maxlength Atom = 0x33509 - Media Atom = 0xa505 - Mediagroup Atom = 0xa50a - Menu Atom = 0x37f04 - Menuitem Atom = 0x37f08 - Meta Atom = 0x4b004 - Meter Atom = 0xbf05 - Method Atom = 0x2a006 - Mglyph Atom = 0x30006 - Mi Atom = 0x33f02 - Min Atom = 0x33f03 - Minlength Atom = 0x33f09 - Mn Atom = 0x2a902 - Mo Atom = 0x6302 + Map Atom = 0x31803 + Mark Atom = 0xb604 + Marquee Atom = 0x32707 + Math Atom = 0x32e04 + Max Atom = 0x33d03 + Maxlength Atom = 0x33d09 + Media Atom = 0xe605 + Mediagroup Atom = 0xe60a + Menu Atom = 0x38704 + Menuitem Atom = 0x38708 + Meta Atom = 0x4b804 + Meter Atom = 0x9805 + Method Atom = 0x2a806 + Mglyph Atom = 0x30806 + Mi Atom = 0x34702 + Min Atom = 0x34703 + Minlength Atom = 0x34709 + Mn Atom = 0x2b102 + Mo Atom = 0xa402 Ms Atom = 0x67402 - Mtext Atom = 0x34905 - Multiple Atom = 0x35708 - Muted Atom = 0x35f05 - Name Atom = 0xbd04 + Mtext Atom = 0x35105 + Multiple Atom = 0x35f08 + Muted Atom = 0x36705 + Name Atom = 0x9604 Nav Atom = 0x1303 Nobr Atom = 0x3704 - Noembed Atom = 0x4007 - Noframes Atom = 0x5508 - Nomodule Atom = 0x6108 - Nonce Atom = 0x56605 - Noscript Atom = 0x20e08 - Novalidate Atom = 0x2aa0a - Object Atom = 0x26006 - Ol Atom = 0x11802 + Noembed Atom = 0x6c07 + Noframes Atom = 0x8908 + Nomodule Atom = 0xa208 + Nonce Atom = 0x1a605 + Noscript Atom = 0x21608 + Novalidate Atom = 0x2b20a + Object Atom = 0x26806 + Ol Atom = 0x13702 Onabort Atom = 0x19507 - Onafterprint Atom = 0x22e0c - Onautocomplete Atom = 0x26e0e - Onautocompleteerror Atom = 0x26e13 + Onafterprint Atom = 0x2360c + Onautocomplete Atom = 0x2760e + Onautocompleteerror Atom = 0x27613 Onauxclick Atom = 0x61f0a Onbeforeprint Atom = 0x69e0d Onbeforeunload Atom = 0x6e70e - Onblur Atom = 0x5c606 - Oncancel Atom = 0xea08 + Onblur Atom = 0x56d06 + Oncancel Atom = 0x11908 Oncanplay Atom = 0x14d09 Oncanplaythrough Atom = 0x14d10 - Onchange Atom = 0x41308 - Onclick Atom = 0x2ed07 - Onclose Atom = 0x36407 - Oncontextmenu Atom = 0x3760d - Oncopy Atom = 0x38906 - Oncuechange Atom = 0x38f0b - Oncut Atom = 0x39a05 - Ondblclick Atom = 0x39f0a - Ondrag Atom = 0x3a906 - Ondragend Atom = 0x3a909 - Ondragenter Atom = 0x3b20b - Ondragexit Atom = 0x3bd0a - Ondragleave Atom = 0x3d70b - Ondragover Atom = 0x3e20a - Ondragstart Atom = 0x3ec0b - Ondrop Atom = 0x3fb06 - Ondurationchange Atom = 0x40b10 - Onemptied Atom = 0x40209 - Onended Atom = 0x41b07 - Onerror Atom = 0x42207 - Onfocus Atom = 0x42907 - Onhashchange Atom = 0x4350c - Oninput Atom = 0x44107 - Oninvalid Atom = 0x44d09 - Onkeydown Atom = 0x45609 - Onkeypress Atom = 0x4630a - Onkeyup Atom = 0x47807 - Onlanguagechange Atom = 0x48510 - Onload Atom = 0x49506 - Onloadeddata Atom = 0x4950c - Onloadedmetadata Atom = 0x4a810 - Onloadend Atom = 0x4be09 - Onloadstart Atom = 0x4c70b - Onmessage Atom = 0x4d209 - Onmessageerror Atom = 0x4d20e - Onmousedown Atom = 0x4e00b - Onmouseenter Atom = 0x4eb0c - Onmouseleave Atom = 0x4f70c - Onmousemove Atom = 0x5030b - Onmouseout Atom = 0x50e0a - Onmouseover Atom = 0x51b0b - Onmouseup Atom = 0x52609 - Onmousewheel Atom = 0x5340c - Onoffline Atom = 0x54009 - Ononline Atom = 0x54908 - Onpagehide Atom = 0x5510a - Onpageshow Atom = 0x56b0a - Onpaste Atom = 0x57707 - Onpause Atom = 0x59207 - Onplay Atom = 0x59c06 - Onplaying Atom = 0x59c09 - Onpopstate Atom = 0x5a50a - Onprogress Atom = 0x5af0a + Onchange Atom = 0x41b08 + Onclick Atom = 0x2f507 + Onclose Atom = 0x36c07 + Oncontextmenu Atom = 0x37e0d + Oncopy Atom = 0x39106 + Oncuechange Atom = 0x3970b + Oncut Atom = 0x3a205 + Ondblclick Atom = 0x3a70a + Ondrag Atom = 0x3b106 + Ondragend Atom = 0x3b109 + Ondragenter Atom = 0x3ba0b + Ondragexit Atom = 0x3c50a + Ondragleave Atom = 0x3df0b + Ondragover Atom = 0x3ea0a + Ondragstart Atom = 0x3f40b + Ondrop Atom = 0x40306 + Ondurationchange Atom = 0x41310 + Onemptied Atom = 0x40a09 + Onended Atom = 0x42307 + Onerror Atom = 0x42a07 + Onfocus Atom = 0x43107 + Onhashchange Atom = 0x43d0c + Oninput Atom = 0x44907 + Oninvalid Atom = 0x45509 + Onkeydown Atom = 0x45e09 + Onkeypress Atom = 0x46b0a + Onkeyup Atom = 0x48007 + Onlanguagechange Atom = 0x48d10 + Onload Atom = 0x49d06 + Onloadeddata Atom = 0x49d0c + Onloadedmetadata Atom = 0x4b010 + Onloadend Atom = 0x4c609 + Onloadstart Atom = 0x4cf0b + Onmessage Atom = 0x4da09 + Onmessageerror Atom = 0x4da0e + Onmousedown Atom = 0x4e80b + Onmouseenter Atom = 0x4f30c + Onmouseleave Atom = 0x4ff0c + Onmousemove Atom = 0x50b0b + Onmouseout Atom = 0x5160a + Onmouseover Atom = 0x5230b + Onmouseup Atom = 0x52e09 + Onmousewheel Atom = 0x53c0c + Onoffline Atom = 0x54809 + Ononline Atom = 0x55108 + Onpagehide Atom = 0x5590a + Onpageshow Atom = 0x5730a + Onpaste Atom = 0x57f07 + Onpause Atom = 0x59a07 + Onplay Atom = 0x5a406 + Onplaying Atom = 0x5a409 + Onpopstate Atom = 0x5ad0a + Onprogress Atom = 0x5b70a Onratechange Atom = 0x5cc0c Onrejectionhandled Atom = 0x5d812 Onreset Atom = 0x5ea07 @@ -268,72 +268,74 @@ const ( Onstorage Atom = 0x66209 Onsubmit Atom = 0x66b08 Onsuspend Atom = 0x67b09 - Ontimeupdate Atom = 0x1310c + Ontimeupdate Atom = 0x400c Ontoggle Atom = 0x68408 Onunhandledrejection Atom = 0x68c14 Onunload Atom = 0x6ab08 Onvolumechange Atom = 0x6b30e Onwaiting Atom = 0x6c109 Onwheel Atom = 0x6ca07 - Open Atom = 0x56304 - Optgroup Atom = 0xf708 + Open Atom = 0x1a304 + Optgroup Atom = 0x5f08 Optimum Atom = 0x6d107 Option Atom = 0x6e306 - Output Atom = 0x51506 + Output Atom = 0x51d06 P Atom = 0xc01 Param Atom = 0xc05 - Pattern Atom = 0x4f07 - Picture Atom = 0xae07 - Ping Atom = 0xfe04 - Placeholder Atom = 0x1120b - Plaintext Atom = 0x1ae09 - Playsinline Atom = 0x1210b - Poster Atom = 0x2c706 - Pre Atom = 0x46803 - Preload Atom = 0x47e07 - Progress Atom = 0x5b108 - Prompt Atom = 0x52e06 - Public Atom = 0x57e06 - Q Atom = 0x8e01 + Pattern Atom = 0x6607 + Picture Atom = 0x7b07 + Ping Atom = 0xef04 + Placeholder Atom = 0x1310b + Plaintext Atom = 0x1b209 + Playsinline Atom = 0x1400b + Poster Atom = 0x2cf06 + Pre Atom = 0x47003 + Preload Atom = 0x48607 + Progress Atom = 0x5b908 + Prompt Atom = 0x53606 + Public Atom = 0x58606 + Q Atom = 0xcf01 Radiogroup Atom = 0x30a - Readonly Atom = 0x34f08 - Referrerpolicy Atom = 0x3c90e - Rel Atom = 0x47f03 - Required Atom = 0x24408 - Reversed Atom = 0xb308 - Rows Atom = 0x3a04 - Rowspan Atom = 0x3a07 - Rp Atom = 0x23402 + Rb Atom = 0x3a02 + Readonly Atom = 0x35708 + Referrerpolicy Atom = 0x3d10e + Rel Atom = 0x48703 + Required Atom = 0x24c08 + Reversed Atom = 0x8008 + Rows Atom = 0x9c04 + Rowspan Atom = 0x9c07 + Rp Atom = 0x23c02 Rt Atom = 0x19a02 - Ruby Atom = 0xc304 + Rtc Atom = 0x19a03 + Ruby Atom = 0xfb04 S Atom = 0x2501 - Samp Atom = 0x4c04 - Sandbox Atom = 0x10a07 + Samp Atom = 0x7804 + Sandbox Atom = 0x12907 Scope Atom = 0x67505 Scoped Atom = 0x67506 - Script Atom = 0x21006 - Seamless Atom = 0x36908 - Section Atom = 0x5c107 + Script Atom = 0x21806 + Seamless Atom = 0x37108 + Section Atom = 0x56807 Select Atom = 0x63c06 Selected Atom = 0x63c08 Shape Atom = 0x1e505 Size Atom = 0x5f504 Sizes Atom = 0x5f505 Slot Atom = 0x1ef04 - Small Atom = 0x1fe05 + Small Atom = 0x20605 Sortable Atom = 0x65108 - Sorted Atom = 0x32f06 - Source Atom = 0x37006 - Spacer Atom = 0x42f06 - Span Atom = 0x3d04 - Spellcheck Atom = 0x46c0a - Src Atom = 0x5b803 - Srcdoc Atom = 0x5b806 + Sorted Atom = 0x33706 + Source Atom = 0x37806 + Spacer Atom = 0x43706 + Span Atom = 0x9f04 + Spellcheck Atom = 0x4740a + Src Atom = 0x5c003 + Srcdoc Atom = 0x5c006 Srclang Atom = 0x5f907 Srcset Atom = 0x6f906 - Start Atom = 0x3f205 - Step Atom = 0x57b04 - Strike Atom = 0x9106 + Start Atom = 0x3fa05 + Step Atom = 0x58304 + Strike Atom = 0xd206 Strong Atom = 0x6dd06 Style Atom = 0x6ff05 Sub Atom = 0x66d03 @@ -341,36 +343,36 @@ const ( Sup Atom = 0x70b03 Svg Atom = 0x70e03 System Atom = 0x71106 - Tabindex Atom = 0x4b608 - Table Atom = 0x58d05 - Target Atom = 0x2bc06 + Tabindex Atom = 0x4be08 + Table Atom = 0x59505 + Target Atom = 0x2c406 Tbody Atom = 0x2705 - Td Atom = 0x5e02 + Td Atom = 0x9202 Template Atom = 0x71408 - Textarea Atom = 0x34a08 - Tfoot Atom = 0xc905 + Textarea Atom = 0x35208 + Tfoot Atom = 0xf505 Th Atom = 0x15602 - Thead Atom = 0x32805 - Time Atom = 0x13304 - Title Atom = 0xe105 - Tr Atom = 0x8b02 - Track Atom = 0x19b05 - Translate Atom = 0x1b609 - Tt Atom = 0x5102 - Type Atom = 0x9804 - Typemustmatch Atom = 0x2880d + Thead Atom = 0x33005 + Time Atom = 0x4204 + Title Atom = 0x11005 + Tr Atom = 0xcc02 + Track Atom = 0x1ba05 + Translate Atom = 0x1f209 + Tt Atom = 0x6802 + Type Atom = 0xd904 + Typemustmatch Atom = 0x2900d U Atom = 0xb01 - Ul Atom = 0x6602 - Updateviacache Atom = 0x1370e - Usemap Atom = 0x59606 + Ul Atom = 0xa702 + Updateviacache Atom = 0x460e + Usemap Atom = 0x59e06 Value Atom = 0x1505 Var Atom = 0x16d03 - Video Atom = 0x2e905 - Wbr Atom = 0x57403 + Video Atom = 0x2f105 + Wbr Atom = 0x57c03 Width Atom = 0x64905 Workertype Atom = 0x71c0a Wrap Atom = 0x72604 - Xmp Atom = 0x11003 + Xmp Atom = 0x12f03 ) const hash0 = 0x81cdf10e @@ -378,399 +380,401 @@ const hash0 = 0x81cdf10e const maxAtomLen = 25 var table = [1 << 9]Atom{ - 0x1: 0xa50a, // mediagroup - 0x2: 0x2dc04, // lang + 0x1: 0xe60a, // mediagroup + 0x2: 0x2e404, // lang 0x4: 0x2c09, // accesskey - 0x5: 0x5708, // frameset + 0x5: 0x8b08, // frameset 0x7: 0x63a08, // onselect 0x8: 0x71106, // system 0xa: 0x64905, // width - 0xc: 0x2810b, // formenctype - 0xd: 0x11802, // ol - 0xe: 0x38f0b, // oncuechange + 0xc: 0x2890b, // formenctype + 0xd: 0x13702, // ol + 0xe: 0x3970b, // oncuechange 0x10: 0x14b03, // bdo - 0x11: 0xe605, // audio + 0x11: 0x11505, // audio 0x12: 0x17a09, // draggable - 0x14: 0x2e905, // video - 0x15: 0x2a902, // mn - 0x16: 0x37f04, // menu - 0x17: 0x2c706, // poster - 0x19: 0xca06, // footer - 0x1a: 0x2a006, // method - 0x1b: 0x2b008, // datetime + 0x14: 0x2f105, // video + 0x15: 0x2b102, // mn + 0x16: 0x38704, // menu + 0x17: 0x2cf06, // poster + 0x19: 0xf606, // footer + 0x1a: 0x2a806, // method + 0x1b: 0x2b808, // datetime 0x1c: 0x19507, // onabort - 0x1d: 0x1370e, // updateviacache - 0x1e: 0xd005, // async - 0x1f: 0x49506, // onload - 0x21: 0xea08, // oncancel + 0x1d: 0x460e, // updateviacache + 0x1e: 0xff05, // async + 0x1f: 0x49d06, // onload + 0x21: 0x11908, // oncancel 0x22: 0x62908, // onseeked - 0x23: 0x2fa05, // image + 0x23: 0x30205, // image 0x24: 0x5d812, // onrejectionhandled 0x26: 0x17404, // link - 0x27: 0x51506, // output - 0x28: 0x32904, // head - 0x29: 0x4f70c, // onmouseleave - 0x2a: 0x57707, // onpaste - 0x2b: 0x59c09, // onplaying + 0x27: 0x51d06, // output + 0x28: 0x33104, // head + 0x29: 0x4ff0c, // onmouseleave + 0x2a: 0x57f07, // onpaste + 0x2b: 0x5a409, // onplaying 0x2c: 0x1c407, // colspan 0x2f: 0x1bf05, // color 0x30: 0x5f504, // size - 0x31: 0x2e00a, // http-equiv + 0x31: 0x2e80a, // http-equiv 0x33: 0x601, // i - 0x34: 0x5510a, // onpagehide + 0x34: 0x5590a, // onpagehide 0x35: 0x68c14, // onunhandledrejection - 0x37: 0x42207, // onerror - 0x3a: 0x12c08, // basefont + 0x37: 0x42a07, // onerror + 0x3a: 0x3b08, // basefont 0x3f: 0x1303, // nav 0x40: 0x17704, // kind - 0x41: 0x34f08, // readonly - 0x42: 0x30006, // mglyph - 0x44: 0x7102, // li - 0x46: 0x2cd06, // hidden + 0x41: 0x35708, // readonly + 0x42: 0x30806, // mglyph + 0x44: 0xb202, // li + 0x46: 0x2d506, // hidden 0x47: 0x70e03, // svg - 0x48: 0x57b04, // step - 0x49: 0x23709, // integrity - 0x4a: 0x57e06, // public - 0x4c: 0x1a703, // col + 0x48: 0x58304, // step + 0x49: 0x23f09, // integrity + 0x4a: 0x58606, // public + 0x4c: 0x1ab03, // col 0x4d: 0x1870a, // blockquote - 0x4e: 0x34702, // h5 - 0x50: 0x5b108, // progress + 0x4e: 0x34f02, // h5 + 0x50: 0x5b908, // progress 0x51: 0x5f505, // sizes - 0x52: 0x33d02, // h4 - 0x56: 0x32805, // thead - 0x57: 0x9507, // keytype - 0x58: 0x5af0a, // onprogress - 0x59: 0x44309, // inputmode - 0x5a: 0x3a909, // ondragend - 0x5d: 0x39a05, // oncut - 0x5e: 0x42f06, // spacer - 0x5f: 0x1a708, // colgroup + 0x52: 0x34502, // h4 + 0x56: 0x33005, // thead + 0x57: 0xd607, // keytype + 0x58: 0x5b70a, // onprogress + 0x59: 0x44b09, // inputmode + 0x5a: 0x3b109, // ondragend + 0x5d: 0x3a205, // oncut + 0x5e: 0x43706, // spacer + 0x5f: 0x1ab08, // colgroup 0x62: 0x16502, // is - 0x65: 0xd002, // as - 0x66: 0x54009, // onoffline - 0x67: 0x32f06, // sorted - 0x69: 0x48510, // onlanguagechange - 0x6c: 0x4350c, // onhashchange - 0x6d: 0xbd04, // name - 0x6e: 0xc905, // tfoot - 0x6f: 0x55904, // desc - 0x70: 0x33503, // max + 0x65: 0x3c02, // as + 0x66: 0x54809, // onoffline + 0x67: 0x33706, // sorted + 0x69: 0x48d10, // onlanguagechange + 0x6c: 0x43d0c, // onhashchange + 0x6d: 0x9604, // name + 0x6e: 0xf505, // tfoot + 0x6f: 0x56104, // desc + 0x70: 0x33d03, // max 0x72: 0x1ea06, // coords - 0x73: 0x30502, // h3 + 0x73: 0x30d02, // h3 0x74: 0x6e70e, // onbeforeunload - 0x75: 0x3a04, // rows + 0x75: 0x9c04, // rows 0x76: 0x63c06, // select - 0x77: 0xbf05, // meter - 0x78: 0x38306, // itemid - 0x79: 0x5340c, // onmousewheel - 0x7a: 0x5b806, // srcdoc - 0x7d: 0x19b05, // track - 0x7f: 0x31708, // itemtype - 0x82: 0x6302, // mo - 0x83: 0x41308, // onchange - 0x84: 0x32907, // headers + 0x77: 0x9805, // meter + 0x78: 0x38b06, // itemid + 0x79: 0x53c0c, // onmousewheel + 0x7a: 0x5c006, // srcdoc + 0x7d: 0x1ba05, // track + 0x7f: 0x31f08, // itemtype + 0x82: 0xa402, // mo + 0x83: 0x41b08, // onchange + 0x84: 0x33107, // headers 0x85: 0x5cc0c, // onratechange 0x86: 0x60819, // onsecuritypolicyviolation - 0x88: 0x49d08, // datalist - 0x89: 0x4e00b, // onmousedown + 0x88: 0x4a508, // datalist + 0x89: 0x4e80b, // onmousedown 0x8a: 0x1ef04, // slot - 0x8b: 0x4a810, // onloadedmetadata + 0x8b: 0x4b010, // onloadedmetadata 0x8c: 0x1a06, // accept - 0x8d: 0x26006, // object + 0x8d: 0x26806, // object 0x91: 0x6b30e, // onvolumechange 0x92: 0x2107, // charset - 0x93: 0x26e13, // onautocompleteerror - 0x94: 0x8013, // allowpaymentrequest + 0x93: 0x27613, // onautocompleteerror + 0x94: 0xc113, // allowpaymentrequest 0x95: 0x2804, // body - 0x96: 0xdb07, // default + 0x96: 0x10a07, // default 0x97: 0x63c08, // selected - 0x98: 0x21604, // face + 0x98: 0x21e04, // face 0x99: 0x1e505, // shape 0x9b: 0x68408, // ontoggle 0x9e: 0x64b02, // dt - 0x9f: 0x7504, // mark + 0x9f: 0xb604, // mark 0xa1: 0xb01, // u 0xa4: 0x6ab08, // onunload - 0xa5: 0xf504, // loop + 0xa5: 0x5d04, // loop 0xa6: 0x16408, // disabled - 0xaa: 0x41b07, // onended - 0xab: 0x6f0a, // malignmark + 0xaa: 0x42307, // onended + 0xab: 0xb00a, // malignmark 0xad: 0x67b09, // onsuspend - 0xae: 0x34905, // mtext + 0xae: 0x35105, // mtext 0xaf: 0x64f06, // onsort - 0xb0: 0x55d08, // itemprop + 0xb0: 0x19d08, // itemprop 0xb3: 0x67109, // itemscope 0xb4: 0x17305, // blink - 0xb6: 0x3a906, // ondrag - 0xb7: 0x6602, // ul - 0xb8: 0x26604, // form - 0xb9: 0x10a07, // sandbox - 0xba: 0x5705, // frame + 0xb6: 0x3b106, // ondrag + 0xb7: 0xa702, // ul + 0xb8: 0x26e04, // form + 0xb9: 0x12907, // sandbox + 0xba: 0x8b05, // frame 0xbb: 0x1505, // value 0xbc: 0x66209, // onstorage - 0xbf: 0x6907, // acronym + 0xbf: 0xaa07, // acronym 0xc0: 0x19a02, // rt 0xc2: 0x202, // br - 0xc3: 0x21e08, // fieldset - 0xc4: 0x2880d, // typemustmatch - 0xc5: 0x6108, // nomodule - 0xc6: 0x4007, // noembed + 0xc3: 0x22608, // fieldset + 0xc4: 0x2900d, // typemustmatch + 0xc5: 0xa208, // nomodule + 0xc6: 0x6c07, // noembed 0xc7: 0x69e0d, // onbeforeprint 0xc8: 0x19106, // button - 0xc9: 0x2ed07, // onclick + 0xc9: 0x2f507, // onclick 0xca: 0x70407, // summary - 0xcd: 0xc304, // ruby - 0xce: 0x5bd05, // class - 0xcf: 0x3ec0b, // ondragstart - 0xd0: 0x22907, // caption - 0xd4: 0x9c0e, // allowusermedia - 0xd5: 0x4c70b, // onloadstart + 0xcd: 0xfb04, // ruby + 0xce: 0x56405, // class + 0xcf: 0x3f40b, // ondragstart + 0xd0: 0x23107, // caption + 0xd4: 0xdd0e, // allowusermedia + 0xd5: 0x4cf0b, // onloadstart 0xd9: 0x16b03, // div - 0xda: 0x4a104, // list - 0xdb: 0x32604, // math - 0xdc: 0x44305, // input - 0xdf: 0x3e20a, // ondragover - 0xe0: 0x2d602, // h2 - 0xe2: 0x1ae09, // plaintext - 0xe4: 0x4eb0c, // onmouseenter - 0xe7: 0x47107, // checked - 0xe8: 0x46803, // pre - 0xea: 0x35708, // multiple - 0xeb: 0x7903, // bdi - 0xec: 0x33509, // maxlength - 0xed: 0x8e01, // q + 0xda: 0x4a904, // list + 0xdb: 0x32e04, // math + 0xdc: 0x44b05, // input + 0xdf: 0x3ea0a, // ondragover + 0xe0: 0x2de02, // h2 + 0xe2: 0x1b209, // plaintext + 0xe4: 0x4f30c, // onmouseenter + 0xe7: 0x47907, // checked + 0xe8: 0x47003, // pre + 0xea: 0x35f08, // multiple + 0xeb: 0xba03, // bdi + 0xec: 0x33d09, // maxlength + 0xed: 0xcf01, // q 0xee: 0x61f0a, // onauxclick - 0xf0: 0x57403, // wbr - 0xf2: 0x12c04, // base + 0xf0: 0x57c03, // wbr + 0xf2: 0x3b04, // base 0xf3: 0x6e306, // option - 0xf5: 0x40b10, // ondurationchange - 0xf7: 0x5508, // noframes - 0xf9: 0x3fd08, // dropzone + 0xf5: 0x41310, // ondurationchange + 0xf7: 0x8908, // noframes + 0xf9: 0x40508, // dropzone 0xfb: 0x67505, // scope - 0xfc: 0xb308, // reversed - 0xfd: 0x3b20b, // ondragenter - 0xfe: 0x3f205, // start - 0xff: 0x11003, // xmp + 0xfc: 0x8008, // reversed + 0xfd: 0x3ba0b, // ondragenter + 0xfe: 0x3fa05, // start + 0xff: 0x12f03, // xmp 0x100: 0x5f907, // srclang - 0x101: 0x2ff03, // img + 0x101: 0x30703, // img 0x104: 0x101, // b - 0x105: 0x24c03, // for - 0x106: 0xd805, // aside - 0x107: 0x44107, // oninput - 0x108: 0x34e04, // area - 0x109: 0x29c0a, // formmethod + 0x105: 0x25403, // for + 0x106: 0x10705, // aside + 0x107: 0x44907, // oninput + 0x108: 0x35604, // area + 0x109: 0x2a40a, // formmethod 0x10a: 0x72604, // wrap - 0x10c: 0x23402, // rp - 0x10d: 0x4630a, // onkeypress - 0x10e: 0x5102, // tt - 0x110: 0x33f02, // mi - 0x111: 0x35f05, // muted - 0x112: 0xc703, // alt - 0x113: 0x1a004, // code - 0x114: 0x4202, // em - 0x115: 0x3bd0a, // ondragexit - 0x117: 0x3d04, // span + 0x10c: 0x23c02, // rp + 0x10d: 0x46b0a, // onkeypress + 0x10e: 0x6802, // tt + 0x110: 0x34702, // mi + 0x111: 0x36705, // muted + 0x112: 0xf303, // alt + 0x113: 0x5c504, // code + 0x114: 0x6e02, // em + 0x115: 0x3c50a, // ondragexit + 0x117: 0x9f04, // span 0x119: 0x6d708, // manifest - 0x11a: 0x37f08, // menuitem - 0x11b: 0x58307, // content + 0x11a: 0x38708, // menuitem + 0x11b: 0x58b07, // content 0x11d: 0x6c109, // onwaiting - 0x11f: 0x4be09, // onloadend - 0x121: 0x3760d, // oncontextmenu - 0x123: 0x5c606, // onblur - 0x124: 0x3f407, // article - 0x125: 0xba03, // dir - 0x126: 0xfe04, // ping - 0x127: 0x24408, // required - 0x128: 0x44d09, // oninvalid - 0x129: 0x7005, // align - 0x12b: 0x58204, // icon + 0x11f: 0x4c609, // onloadend + 0x121: 0x37e0d, // oncontextmenu + 0x123: 0x56d06, // onblur + 0x124: 0x3fc07, // article + 0x125: 0x9303, // dir + 0x126: 0xef04, // ping + 0x127: 0x24c08, // required + 0x128: 0x45509, // oninvalid + 0x129: 0xb105, // align + 0x12b: 0x58a04, // icon 0x12c: 0x64d02, // h6 0x12d: 0x1c404, // cols - 0x12e: 0x2260a, // figcaption - 0x12f: 0x45609, // onkeydown + 0x12e: 0x22e0a, // figcaption + 0x12f: 0x45e09, // onkeydown 0x130: 0x66b08, // onsubmit 0x131: 0x14d09, // oncanplay 0x132: 0x70b03, // sup 0x133: 0xc01, // p - 0x135: 0x40209, // onemptied - 0x136: 0x38906, // oncopy - 0x137: 0x55c04, // cite - 0x138: 0x39f0a, // ondblclick - 0x13a: 0x5030b, // onmousemove + 0x135: 0x40a09, // onemptied + 0x136: 0x39106, // oncopy + 0x137: 0x19c04, // cite + 0x138: 0x3a70a, // ondblclick + 0x13a: 0x50b0b, // onmousemove 0x13c: 0x66d03, // sub - 0x13d: 0x47f03, // rel - 0x13e: 0xf708, // optgroup - 0x142: 0x3a07, // rowspan - 0x143: 0x37006, // source - 0x144: 0x20e08, // noscript - 0x145: 0x56304, // open - 0x146: 0x1fc03, // ins - 0x147: 0x24c0d, // foreignObject - 0x148: 0x5a50a, // onpopstate - 0x14a: 0x28507, // enctype - 0x14b: 0x26e0e, // onautocomplete - 0x14c: 0x34a08, // textarea - 0x14e: 0x2700c, // autocomplete + 0x13d: 0x48703, // rel + 0x13e: 0x5f08, // optgroup + 0x142: 0x9c07, // rowspan + 0x143: 0x37806, // source + 0x144: 0x21608, // noscript + 0x145: 0x1a304, // open + 0x146: 0x20403, // ins + 0x147: 0x2540d, // foreignObject + 0x148: 0x5ad0a, // onpopstate + 0x14a: 0x28d07, // enctype + 0x14b: 0x2760e, // onautocomplete + 0x14c: 0x35208, // textarea + 0x14e: 0x2780c, // autocomplete 0x14f: 0x15702, // hr 0x150: 0x1de08, // controls - 0x151: 0xda02, // id - 0x153: 0x22e0c, // onafterprint - 0x155: 0x2590d, // foreignobject - 0x156: 0x31f07, // marquee - 0x157: 0x59207, // onpause + 0x151: 0x10902, // id + 0x153: 0x2360c, // onafterprint + 0x155: 0x2610d, // foreignobject + 0x156: 0x32707, // marquee + 0x157: 0x59a07, // onpause 0x158: 0x5e602, // dl - 0x159: 0x14306, // height - 0x15a: 0x33f03, // min - 0x15b: 0xba07, // dirname - 0x15c: 0x1b609, // translate - 0x15d: 0x14704, // html - 0x15e: 0x33f09, // minlength - 0x15f: 0x47e07, // preload + 0x159: 0x5206, // height + 0x15a: 0x34703, // min + 0x15b: 0x9307, // dirname + 0x15c: 0x1f209, // translate + 0x15d: 0x5604, // html + 0x15e: 0x34709, // minlength + 0x15f: 0x48607, // preload 0x160: 0x71408, // template - 0x161: 0x3d70b, // ondragleave - 0x164: 0x5b803, // src + 0x161: 0x3df0b, // ondragleave + 0x162: 0x3a02, // rb + 0x164: 0x5c003, // src 0x165: 0x6dd06, // strong - 0x167: 0x4c04, // samp + 0x167: 0x7804, // samp 0x168: 0x6f307, // address - 0x169: 0x54908, // ononline - 0x16b: 0x1120b, // placeholder - 0x16c: 0x2bc06, // target - 0x16d: 0x1fe05, // small + 0x169: 0x55108, // ononline + 0x16b: 0x1310b, // placeholder + 0x16c: 0x2c406, // target + 0x16d: 0x20605, // small 0x16e: 0x6ca07, // onwheel 0x16f: 0x1c90a, // annotation - 0x170: 0x46c0a, // spellcheck - 0x171: 0x4607, // details - 0x172: 0xd406, // canvas - 0x173: 0x10209, // autofocus + 0x170: 0x4740a, // spellcheck + 0x171: 0x7207, // details + 0x172: 0x10306, // canvas + 0x173: 0x12109, // autofocus 0x174: 0xc05, // param - 0x176: 0x45b08, // download - 0x177: 0x44a03, // del - 0x178: 0x36407, // onclose - 0x179: 0x7803, // kbd - 0x17a: 0x31106, // applet - 0x17b: 0x2d804, // href + 0x176: 0x46308, // download + 0x177: 0x45203, // del + 0x178: 0x36c07, // onclose + 0x179: 0xb903, // kbd + 0x17a: 0x31906, // applet + 0x17b: 0x2e004, // href 0x17c: 0x5f108, // onresize - 0x17e: 0x4950c, // onloadeddata - 0x180: 0x8b02, // tr - 0x181: 0x2b80a, // formtarget - 0x182: 0xe105, // title + 0x17e: 0x49d0c, // onloadeddata + 0x180: 0xcc02, // tr + 0x181: 0x2c00a, // formtarget + 0x182: 0x11005, // title 0x183: 0x6ff05, // style - 0x184: 0x9106, // strike - 0x185: 0x59606, // usemap - 0x186: 0x2f406, // iframe + 0x184: 0xd206, // strike + 0x185: 0x59e06, // usemap + 0x186: 0x2fc06, // iframe 0x187: 0x1004, // main - 0x189: 0xae07, // picture - 0x18c: 0x30e05, // ismap - 0x18e: 0x49d04, // data - 0x18f: 0xf105, // label - 0x191: 0x3c90e, // referrerpolicy + 0x189: 0x7b07, // picture + 0x18c: 0x31605, // ismap + 0x18e: 0x4a504, // data + 0x18f: 0x5905, // label + 0x191: 0x3d10e, // referrerpolicy 0x192: 0x15602, // th - 0x194: 0x52e06, // prompt - 0x195: 0x5c107, // section + 0x194: 0x53606, // prompt + 0x195: 0x56807, // section 0x197: 0x6d107, // optimum - 0x198: 0x2d304, // high + 0x198: 0x2db04, // high 0x199: 0x15c02, // h1 0x19a: 0x65909, // onstalled 0x19b: 0x16d03, // var - 0x19c: 0x13304, // time + 0x19c: 0x4204, // time 0x19e: 0x67402, // ms - 0x19f: 0x32906, // header - 0x1a0: 0x4d209, // onmessage - 0x1a1: 0x56605, // nonce - 0x1a2: 0x2660a, // formaction - 0x1a3: 0x21806, // center + 0x19f: 0x33106, // header + 0x1a0: 0x4da09, // onmessage + 0x1a1: 0x1a605, // nonce + 0x1a2: 0x26e0a, // formaction + 0x1a3: 0x22006, // center 0x1a4: 0x3704, // nobr - 0x1a5: 0x58d05, // table - 0x1a6: 0x4a107, // listing + 0x1a5: 0x59505, // table + 0x1a6: 0x4a907, // listing 0x1a7: 0x18106, // legend - 0x1a9: 0x29309, // challenge - 0x1aa: 0x24006, // figure - 0x1ab: 0xa505, // media - 0x1ae: 0x9804, // type - 0x1af: 0x13004, // font - 0x1b0: 0x4d20e, // onmessageerror - 0x1b1: 0x36908, // seamless - 0x1b2: 0x5f03, // dfn - 0x1b3: 0x1a205, // defer - 0x1b4: 0x8203, // low - 0x1b5: 0x63109, // onseeking - 0x1b6: 0x51b0b, // onmouseover - 0x1b7: 0x2aa0a, // novalidate + 0x1a9: 0x29b09, // challenge + 0x1aa: 0x24806, // figure + 0x1ab: 0xe605, // media + 0x1ae: 0xd904, // type + 0x1af: 0x3f04, // font + 0x1b0: 0x4da0e, // onmessageerror + 0x1b1: 0x37108, // seamless + 0x1b2: 0x8703, // dfn + 0x1b3: 0x5c705, // defer + 0x1b4: 0xc303, // low + 0x1b5: 0x19a03, // rtc + 0x1b6: 0x5230b, // onmouseover + 0x1b7: 0x2b20a, // novalidate 0x1b8: 0x71c0a, // workertype - 0x1ba: 0x3c507, // itemref + 0x1ba: 0x3cd07, // itemref 0x1bd: 0x1, // a - 0x1be: 0x31003, // map - 0x1bf: 0x1310c, // ontimeupdate + 0x1be: 0x31803, // map + 0x1bf: 0x400c, // ontimeupdate 0x1c0: 0x15e07, // bgsound 0x1c1: 0x3206, // keygen 0x1c2: 0x2705, // tbody 0x1c5: 0x64406, // onshow 0x1c7: 0x2501, // s - 0x1c8: 0x4f07, // pattern + 0x1c8: 0x6607, // pattern 0x1cc: 0x14d10, // oncanplaythrough - 0x1ce: 0x2cf02, // dd + 0x1ce: 0x2d702, // dd 0x1cf: 0x6f906, // srcset 0x1d0: 0x17003, // big 0x1d2: 0x65108, // sortable - 0x1d3: 0x47807, // onkeyup - 0x1d5: 0x59c06, // onplay - 0x1d7: 0x4b004, // meta - 0x1d8: 0x3fb06, // ondrop + 0x1d3: 0x48007, // onkeyup + 0x1d5: 0x5a406, // onplay + 0x1d7: 0x4b804, // meta + 0x1d8: 0x40306, // ondrop 0x1da: 0x60008, // onscroll - 0x1db: 0x1f30b, // crossorigin - 0x1dc: 0x56b0a, // onpageshow + 0x1db: 0x1fb0b, // crossorigin + 0x1dc: 0x5730a, // onpageshow 0x1dd: 0x4, // abbr - 0x1de: 0x5e02, // td - 0x1df: 0x5830f, // contenteditable - 0x1e0: 0x26a06, // action - 0x1e1: 0x1210b, // playsinline - 0x1e2: 0x42907, // onfocus - 0x1e3: 0x2d808, // hreflang - 0x1e5: 0x50e0a, // onmouseout + 0x1de: 0x9202, // td + 0x1df: 0x58b0f, // contenteditable + 0x1e0: 0x27206, // action + 0x1e1: 0x1400b, // playsinline + 0x1e2: 0x43107, // onfocus + 0x1e3: 0x2e008, // hreflang + 0x1e5: 0x5160a, // onmouseout 0x1e6: 0x5ea07, // onreset - 0x1e7: 0x11d08, // autoplay + 0x1e7: 0x13c08, // autoplay + 0x1e8: 0x63109, // onseeking 0x1ea: 0x67506, // scoped 0x1ec: 0x30a, // radiogroup - 0x1ee: 0x3780b, // contextmenu - 0x1ef: 0x52609, // onmouseup - 0x1f1: 0x2c206, // hgroup - 0x1f2: 0x2000f, // allowfullscreen - 0x1f3: 0x4b608, // tabindex - 0x1f6: 0x30707, // isindex + 0x1ee: 0x3800b, // contextmenu + 0x1ef: 0x52e09, // onmouseup + 0x1f1: 0x2ca06, // hgroup + 0x1f2: 0x2080f, // allowfullscreen + 0x1f3: 0x4be08, // tabindex + 0x1f6: 0x30f07, // isindex 0x1f7: 0x1a0e, // accept-charset - 0x1f8: 0x2a60e, // formnovalidate + 0x1f8: 0x2ae0e, // formnovalidate 0x1fb: 0x1c90e, // annotation-xml - 0x1fc: 0x4205, // embed - 0x1fd: 0x21006, // script - 0x1fe: 0x7a06, // dialog + 0x1fc: 0x6e05, // embed + 0x1fd: 0x21806, // script + 0x1fe: 0xbb06, // dialog 0x1ff: 0x1d707, // command } -const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobro" + - "wspanoembedetailsampatternoframesetdfnomoduleacronymalignmar" + - "kbdialogallowpaymentrequestrikeytypeallowusermediagroupictur" + - "eversedirnameterubyaltfooterasyncanvasidefaultitleaudioncanc" + - "elabelooptgroupingautofocusandboxmplaceholderautoplaysinline" + - "basefontimeupdateviacacheightmlbdoncanplaythrough1bgsoundisa" + - "bledivarbigblinkindraggablegendblockquotebuttonabortrackcode" + - "fercolgrouplaintextranslatecolorcolspannotation-xmlcommandco" + - "ntrolshapecoordslotcrossoriginsmallowfullscreenoscriptfacent" + - "erfieldsetfigcaptionafterprintegrityfigurequiredforeignObjec" + - "tforeignobjectformactionautocompleteerrorformenctypemustmatc" + - "hallengeformmethodformnovalidatetimeformtargethgrouposterhid" + - "denhigh2hreflanghttp-equivideonclickiframeimageimglyph3isind" + - "exismappletitemtypemarqueematheadersortedmaxlength4minlength" + - "5mtextareadonlymultiplemutedoncloseamlessourceoncontextmenui" + - "temidoncopyoncuechangeoncutondblclickondragendondragenterond" + - "ragexitemreferrerpolicyondragleaveondragoverondragstarticleo" + - "ndropzonemptiedondurationchangeonendedonerroronfocuspaceronh" + - "ashchangeoninputmodeloninvalidonkeydownloadonkeypresspellche" + - "ckedonkeyupreloadonlanguagechangeonloadeddatalistingonloaded" + - "metadatabindexonloadendonloadstartonmessageerroronmousedowno" + - "nmouseenteronmouseleaveonmousemoveonmouseoutputonmouseoveron" + - "mouseupromptonmousewheelonofflineononlineonpagehidescitempro" + - "penonceonpageshowbronpastepublicontenteditableonpausemaponpl" + - "ayingonpopstateonprogressrcdoclassectionbluronratechangeonre" + +const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" + + "asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" + + "sampictureversedfnoframesetdirnameterowspanomoduleacronymali" + + "gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" + + "ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" + + "dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" + + "bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" + + "penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" + + "ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" + + "ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" + + "ignObjectforeignobjectformactionautocompleteerrorformenctype" + + "mustmatchallengeformmethodformnovalidatetimeformtargethgroup" + + "osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" + + "ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" + + "inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" + + "extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" + + "enterondragexitemreferrerpolicyondragleaveondragoverondragst" + + "articleondropzonemptiedondurationchangeonendedonerroronfocus" + + "paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" + + "spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" + + "onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" + + "usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" + + "seoveronmouseupromptonmousewheelonofflineononlineonpagehides" + + "classectionbluronpageshowbronpastepublicontenteditableonpaus" + + "emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" + "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" + "violationauxclickonseekedonseekingonselectedonshowidth6onsor" + "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" + diff --git a/cmd/vendor/golang.org/x/net/html/node.go b/cmd/vendor/golang.org/x/net/html/node.go index 6f136c4ef1..2c1cade607 100644 --- a/cmd/vendor/golang.org/x/net/html/node.go +++ b/cmd/vendor/golang.org/x/net/html/node.go @@ -174,6 +174,16 @@ func (s *nodeStack) index(n *Node) int { return -1 } +// contains returns whether a is within s. +func (s *nodeStack) contains(a atom.Atom) bool { + for _, n := range *s { + if n.DataAtom == a { + return true + } + } + return false +} + // insert inserts a node at the given index. func (s *nodeStack) insert(i int, n *Node) { (*s) = append(*s, nil) @@ -192,3 +202,19 @@ func (s *nodeStack) remove(n *Node) { (*s)[j] = nil *s = (*s)[:j] } + +type insertionModeStack []insertionMode + +func (s *insertionModeStack) pop() (im insertionMode) { + i := len(*s) + im = (*s)[i-1] + *s = (*s)[:i-1] + return im +} + +func (s *insertionModeStack) top() insertionMode { + if i := len(*s); i > 0 { + return (*s)[i-1] + } + return nil +} diff --git a/cmd/vendor/golang.org/x/net/html/parse.go b/cmd/vendor/golang.org/x/net/html/parse.go index 2a5abddc6e..d23e05e064 100644 --- a/cmd/vendor/golang.org/x/net/html/parse.go +++ b/cmd/vendor/golang.org/x/net/html/parse.go @@ -32,6 +32,8 @@ type parser struct { head, form *Node // Other parsing state flags (section 12.2.4.5). scripting, framesetOK bool + // The stack of template insertion modes + templateStack insertionModeStack // im is the current insertion mode. im insertionMode // originalIM is the insertion mode to go back to after completing a text @@ -126,7 +128,7 @@ func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { return -1 } case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { + if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { return -1 } case selectScope: @@ -162,17 +164,17 @@ func (p *parser) clearStackToContext(s scope) { tagAtom := p.oe[i].DataAtom switch s { case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { + if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { p.oe = p.oe[:i+1] return } case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr { + if tagAtom == a.Html || tagAtom == a.Tr || tagAtom == a.Template { p.oe = p.oe[:i+1] return } case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { + if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead || tagAtom == a.Template { p.oe = p.oe[:i+1] return } @@ -183,7 +185,7 @@ func (p *parser) clearStackToContext(s scope) { } // generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. +// the top node has a tag name of dd, dt, li, optgroup, option, p, rb, rp, rt or rtc. // If exceptions are specified, nodes with that name will not be popped off. func (p *parser) generateImpliedEndTags(exceptions ...string) { var i int @@ -192,7 +194,7 @@ loop: n := p.oe[i] if n.Type == ElementNode { switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: + case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: for _, except := range exceptions { if n.Data == except { break loop @@ -207,6 +209,27 @@ loop: p.oe = p.oe[:i+1] } +// generateAllImpliedEndTags pops nodes off the stack of open elements as long as +// the top node has a tag name of caption, colgroup, dd, div, dt, li, optgroup, option, p, rb, +// rp, rt, rtc, span, tbody, td, tfoot, th, thead or tr. +func (p *parser) generateAllImpliedEndTags() { + var i int + for i = len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if n.Type == ElementNode { + switch n.DataAtom { + // TODO: remove this divergence from the HTML5 spec + case a.Caption, a.Colgroup, a.Dd, a.Div, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, + a.Rp, a.Rt, a.Rtc, a.Span, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: + continue + } + } + break + } + + p.oe = p.oe[:i+1] +} + // addChild adds a child node n to the top element, and pushes n onto the stack // of open elements if it is an element node. func (p *parser) addChild(n *Node) { @@ -236,7 +259,7 @@ func (p *parser) shouldFosterParent() bool { // fosterParent adds a child node according to the foster parenting rules. // Section 12.2.6.1, "foster parenting". func (p *parser) fosterParent(n *Node) { - var table, parent, prev *Node + var table, parent, prev, template *Node var i int for i = len(p.oe) - 1; i >= 0; i-- { if p.oe[i].DataAtom == a.Table { @@ -245,6 +268,19 @@ func (p *parser) fosterParent(n *Node) { } } + var j int + for j = len(p.oe) - 1; j >= 0; j-- { + if p.oe[j].DataAtom == a.Template { + template = p.oe[j] + break + } + } + + if template != nil && (table == nil || j < i) { + template.AppendChild(n) + return + } + if table == nil { // The foster parent is the html element. parent = p.oe[0] @@ -415,14 +451,34 @@ func (p *parser) setOriginalIM() { func (p *parser) resetInsertionMode() { for i := len(p.oe) - 1; i >= 0; i-- { n := p.oe[i] - if i == 0 && p.context != nil { + last := i == 0 + if last && p.context != nil { n = p.context } switch n.DataAtom { case a.Select: + if !last { + for ancestor, first := n, p.oe[0]; ancestor != first; { + if ancestor == first { + break + } + ancestor = p.oe[p.oe.index(ancestor)-1] + switch ancestor.DataAtom { + case a.Template: + p.im = inSelectIM + return + case a.Table: + p.im = inSelectInTableIM + return + } + } + } p.im = inSelectIM case a.Td, a.Th: + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 p.im = inCellIM case a.Tr: p.im = inRowIM @@ -434,20 +490,32 @@ func (p *parser) resetInsertionMode() { p.im = inColumnGroupIM case a.Table: p.im = inTableIM + case a.Template: + p.im = p.templateStack.top() case a.Head: - p.im = inBodyIM + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + p.im = inHeadIM case a.Body: p.im = inBodyIM case a.Frameset: p.im = inFramesetIM case a.Html: - p.im = beforeHeadIM + if p.head == nil { + p.im = beforeHeadIM + } else { + p.im = afterHeadIM + } default: + if last { + p.im = inBodyIM + return + } continue } return } - p.im = inBodyIM } const whitespace = " \t\r\n\f" @@ -590,19 +658,36 @@ func inHeadIM(p *parser) bool { case a.Head: // Ignore the token. return true + case a.Template: + p.addElement() + p.afe = append(p.afe, &scopeMarker) + p.framesetOK = false + p.im = inTemplateIM + p.templateStack = append(p.templateStack, inTemplateIM) + return true } case EndTagToken: switch p.tok.DataAtom { case a.Head: - n := p.oe.pop() - if n.DataAtom != a.Head { - panic("html: bad parser state: element not found, in the in-head insertion mode") - } + p.oe.pop() p.im = afterHeadIM return true case a.Body, a.Html, a.Br: p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) return false + case a.Template: + if !p.oe.contains(a.Template) { + return true + } + p.generateAllImpliedEndTags() + if n := p.oe.top(); n.DataAtom != a.Template { + return true + } + p.popUntil(defaultScope, a.Template) + p.clearActiveFormattingElements() + p.templateStack.pop() + p.resetInsertionMode() + return true default: // Ignore the token. return true @@ -648,7 +733,7 @@ func afterHeadIM(p *parser) bool { p.addElement() p.im = inFramesetIM return true - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: p.oe = append(p.oe, p.head) defer p.oe.remove(p.head) return inHeadIM(p) @@ -660,6 +745,8 @@ func afterHeadIM(p *parser) bool { switch p.tok.DataAtom { case a.Body, a.Html, a.Br: // Drop down to creating an implied tag. + case a.Template: + return inHeadIM(p) default: // Ignore the token. return true @@ -727,10 +814,16 @@ func inBodyIM(p *parser) bool { case StartTagToken: switch p.tok.DataAtom { case a.Html: + if p.oe.contains(a.Template) { + return true + } copyAttributes(p.oe[0], p.tok) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: return inHeadIM(p) case a.Body: + if p.oe.contains(a.Template) { + return true + } if len(p.oe) >= 2 { body := p.oe[1] if body.Type == ElementNode && body.DataAtom == a.Body { @@ -767,7 +860,7 @@ func inBodyIM(p *parser) bool { // The newline, if any, will be dealt with by the TextToken case. p.framesetOK = false case a.Form: - if p.form == nil { + if p.oe.contains(a.Template) || p.form == nil { p.popUntil(buttonScope, a.P) p.addElement() p.form = p.top() @@ -952,11 +1045,16 @@ func inBodyIM(p *parser) bool { } p.reconstructActiveFormattingElements() p.addElement() - case a.Rp, a.Rt: + case a.Rb, a.Rtc: if p.elementInScope(defaultScope, a.Ruby) { p.generateImpliedEndTags() } p.addElement() + case a.Rp, a.Rt: + if p.elementInScope(defaultScope, a.Ruby) { + p.generateImpliedEndTags("rtc") + } + p.addElement() case a.Math, a.Svg: p.reconstructActiveFormattingElements() if p.tok.DataAtom == a.Math { @@ -972,7 +1070,13 @@ func inBodyIM(p *parser) bool { p.acknowledgeSelfClosingTag() } return true - case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: + case a.Frame: + // TODO: remove this divergence from the HTML5 spec. + if p.oe.contains(a.Template) { + p.addElement() + return true + } + case a.Caption, a.Col, a.Colgroup, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: // Ignore the token. default: p.reconstructActiveFormattingElements() @@ -993,15 +1097,28 @@ func inBodyIM(p *parser) bool { case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul: p.popUntil(defaultScope, p.tok.DataAtom) case a.Form: - node := p.form - p.form = nil - i := p.indexOfElementInScope(defaultScope, a.Form) - if node == nil || i == -1 || p.oe[i] != node { - // Ignore the token. - return true + if p.oe.contains(a.Template) { + if !p.oe.contains(a.Form) { + // Ignore the token. + return true + } + p.generateImpliedEndTags() + if p.tok.DataAtom == a.Form { + // Ignore the token. + return true + } + p.popUntil(defaultScope, a.Form) + } else { + node := p.form + p.form = nil + i := p.indexOfElementInScope(defaultScope, a.Form) + if node == nil || i == -1 || p.oe[i] != node { + // Ignore the token. + return true + } + p.generateImpliedEndTags() + p.oe.remove(node) } - p.generateImpliedEndTags() - p.oe.remove(node) case a.P: if !p.elementInScope(buttonScope, a.P) { p.parseImpliedToken(StartTagToken, a.P, a.P.String()) @@ -1022,6 +1139,8 @@ func inBodyIM(p *parser) bool { case a.Br: p.tok.Type = StartTagToken return false + case a.Template: + return inHeadIM(p) default: p.inBodyEndTagOther(p.tok.DataAtom) } @@ -1030,6 +1149,21 @@ func inBodyIM(p *parser) bool { Type: CommentNode, Data: p.tok.Data, }) + case ErrorToken: + // TODO: remove this divergence from the HTML5 spec. + if len(p.templateStack) > 0 { + p.im = inTemplateIM + return false + } else { + for _, e := range p.oe { + switch e.DataAtom { + case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc, a.Tbody, a.Td, a.Tfoot, a.Th, + a.Thead, a.Tr, a.Body, a.Html: + default: + return true + } + } + } } return true @@ -1135,6 +1269,12 @@ func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) { switch commonAncestor.DataAtom { case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: p.fosterParent(lastNode) + case a.Template: + // TODO: remove namespace checking + if commonAncestor.Namespace == "html" { + commonAncestor = commonAncestor.LastChild + } + fallthrough default: commonAncestor.AppendChild(lastNode) } @@ -1249,7 +1389,7 @@ func inTableIM(p *parser) bool { } // Ignore the token. return true - case a.Style, a.Script: + case a.Style, a.Script, a.Template: return inHeadIM(p) case a.Input: for _, t := range p.tok.Attr { @@ -1261,7 +1401,7 @@ func inTableIM(p *parser) bool { } // Otherwise drop down to the default action. case a.Form: - if p.form != nil { + if p.oe.contains(a.Template) || p.form != nil { // Ignore the token. return true } @@ -1291,6 +1431,8 @@ func inTableIM(p *parser) bool { case a.Body, a.Caption, a.Col, a.Colgroup, a.Html, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: // Ignore the token. return true + case a.Template: + return inHeadIM(p) } case CommentToken: p.addChild(&Node{ @@ -1386,11 +1528,13 @@ func inColumnGroupIM(p *parser) bool { p.oe.pop() p.acknowledgeSelfClosingTag() return true + case a.Template: + return inHeadIM(p) } case EndTagToken: switch p.tok.DataAtom { case a.Colgroup: - if p.oe.top().DataAtom != a.Html { + if p.oe.top().DataAtom == a.Colgroup { p.oe.pop() p.im = inTableIM } @@ -1398,14 +1542,16 @@ func inColumnGroupIM(p *parser) bool { case a.Col: // Ignore the token. return true + case a.Template: + return inHeadIM(p) } } - if p.oe.top().DataAtom != a.Html { - p.oe.pop() - p.im = inTableIM - return false + if p.oe.top().DataAtom != a.Colgroup { + return true } - return true + p.oe.pop() + p.im = inTableIM + return false } // Section 12.2.6.4.13. @@ -1597,7 +1743,7 @@ func inSelectIM(p *parser) bool { p.tokenizer.NextIsNotRawText() // Ignore the token. return true - case a.Script: + case a.Script, a.Template: return inHeadIM(p) } case EndTagToken: @@ -1618,6 +1764,8 @@ func inSelectIM(p *parser) bool { if p.popUntil(selectScope, a.Select) { p.resetInsertionMode() } + case a.Template: + return inHeadIM(p) } case CommentToken: p.addChild(&Node{ @@ -1650,6 +1798,61 @@ func inSelectInTableIM(p *parser) bool { return inSelectIM(p) } +// Section 12.2.6.4.18. +func inTemplateIM(p *parser) bool { + switch p.tok.Type { + case TextToken, CommentToken, DoctypeToken: + return inBodyIM(p) + case StartTagToken: + switch p.tok.DataAtom { + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: + return inHeadIM(p) + case a.Caption, a.Colgroup, a.Tbody, a.Tfoot, a.Thead: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inTableIM) + p.im = inTableIM + return false + case a.Col: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inColumnGroupIM) + p.im = inColumnGroupIM + return false + case a.Tr: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inTableBodyIM) + p.im = inTableBodyIM + return false + case a.Td, a.Th: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inRowIM) + p.im = inRowIM + return false + default: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inBodyIM) + p.im = inBodyIM + return false + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Template: + return inHeadIM(p) + default: + // Ignore the token. + return true + } + } + if !p.oe.contains(a.Template) { + // Ignore the token. + return true + } + p.popUntil(defaultScope, a.Template) + p.clearActiveFormattingElements() + p.templateStack.pop() + p.resetInsertionMode() + return false +} + // Section 12.2.6.4.19. func afterBodyIM(p *parser) bool { switch p.tok.Type { @@ -1720,6 +1923,11 @@ func inFramesetIM(p *parser) bool { p.acknowledgeSelfClosingTag() case a.Noframes: return inHeadIM(p) + case a.Template: + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + return inTemplateIM(p) } case EndTagToken: switch p.tok.DataAtom { @@ -2064,6 +2272,9 @@ func ParseFragment(r io.Reader, context *Node) ([]*Node, error) { } p.doc.AppendChild(root) p.oe = nodeStack{root} + if context != nil && context.DataAtom == a.Template { + p.templateStack = append(p.templateStack, inTemplateIM) + } p.resetInsertionMode() for n := context; n != nil; n = n.Parent { diff --git a/cmd/vendor/golang.org/x/net/http/httpguts/guts.go b/cmd/vendor/golang.org/x/net/http/httpguts/guts.go new file mode 100644 index 0000000000..e6cd0ced39 --- /dev/null +++ b/cmd/vendor/golang.org/x/net/http/httpguts/guts.go @@ -0,0 +1,50 @@ +// 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, +} diff --git a/cmd/vendor/golang.org/x/net/http2/server.go b/cmd/vendor/golang.org/x/net/http2/server.go index 39ed755a86..72f65c8f7b 100644 --- a/cmd/vendor/golang.org/x/net/http2/server.go +++ b/cmd/vendor/golang.org/x/net/http2/server.go @@ -46,6 +46,7 @@ import ( "sync" "time" + "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) @@ -1817,7 +1818,7 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { if st.trailer != nil { for _, hf := range f.RegularFields() { key := sc.canonicalHeader(hf.Name) - if !ValidTrailerHeader(key) { + 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. @@ -2284,7 +2285,7 @@ func (rws *responseWriterState) hasTrailers() bool { return len(rws.trailers) != // written in the trailers at the end of the response. func (rws *responseWriterState) declareTrailer(k string) { k = http.CanonicalHeaderKey(k) - if !ValidTrailerHeader(k) { + if !httpguts.ValidTrailerHeader(k) { // Forbidden by RFC 7230, section 4.1.2. rws.conn.logf("ignoring invalid trailer %q", k) return @@ -2323,7 +2324,15 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { } _, hasContentType := rws.snapHeader["Content-Type"] if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { - ctype = http.DetectContentType(p) + if cto := rws.snapHeader.Get("X-Content-Type-Options"); strings.EqualFold("nosniff", cto) { + // nosniff is an explicit directive not to guess a content-type. + // Content-sniffing is no less susceptible to polyglot attacks via + // hosted content when done on the server. + ctype = "application/octet-stream" + rws.conn.logf("http2: WriteHeader called with X-Content-Type-Options:nosniff but no Content-Type") + } else { + ctype = http.DetectContentType(p) + } } var date string if _, ok := rws.snapHeader["Date"]; !ok { @@ -2838,41 +2847,6 @@ func new400Handler(err error) http.HandlerFunc { } } -// ValidTrailerHeader reports whether name is a valid header field name to appear -// in trailers. -// See: http://tools.ietf.org/html/rfc7230#section-4.1.2 -func ValidTrailerHeader(name string) bool { - name = http.CanonicalHeaderKey(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, -} - // h1ServerKeepAlivesDisabled reports whether hs has its keep-alives // disabled. See comments on h1ServerShutdownChan above for why // the code is written this way. diff --git a/cmd/vendor/golang.org/x/net/http2/transport.go b/cmd/vendor/golang.org/x/net/http2/transport.go index e6b321f4bb..da91d19dd4 100644 --- a/cmd/vendor/golang.org/x/net/http2/transport.go +++ b/cmd/vendor/golang.org/x/net/http2/transport.go @@ -951,6 +951,9 @@ func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { 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) { diff --git a/cmd/vendor/golang.org/x/net/icmp/dstunreach.go b/cmd/vendor/golang.org/x/net/icmp/dstunreach.go index 75db991dfd..7464bf7ead 100644 --- a/cmd/vendor/golang.org/x/net/icmp/dstunreach.go +++ b/cmd/vendor/golang.org/x/net/icmp/dstunreach.go @@ -16,24 +16,24 @@ func (p *DstUnreach) Len(proto int) int { if p == nil { return 0 } - l, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions) + l, _ := multipartMessageBodyDataLen(proto, true, p.Data, p.Extensions) return 4 + l } // Marshal implements the Marshal method of MessageBody interface. func (p *DstUnreach) Marshal(proto int) ([]byte, error) { - return marshalMultipartMessageBody(proto, p.Data, p.Extensions) + return marshalMultipartMessageBody(proto, true, p.Data, p.Extensions) } // parseDstUnreach parses b as an ICMP destination unreachable message // body. -func parseDstUnreach(proto int, b []byte) (MessageBody, error) { +func parseDstUnreach(proto int, typ Type, b []byte) (MessageBody, error) { if len(b) < 4 { return nil, errMessageTooShort } p := &DstUnreach{} var err error - p.Data, p.Extensions, err = parseMultipartMessageBody(proto, b) + p.Data, p.Extensions, err = parseMultipartMessageBody(proto, typ, b) if err != nil { return nil, err } diff --git a/cmd/vendor/golang.org/x/net/icmp/echo.go b/cmd/vendor/golang.org/x/net/icmp/echo.go index e6f15efd7d..c611f65165 100644 --- a/cmd/vendor/golang.org/x/net/icmp/echo.go +++ b/cmd/vendor/golang.org/x/net/icmp/echo.go @@ -31,7 +31,7 @@ func (p *Echo) Marshal(proto int) ([]byte, error) { } // parseEcho parses b as an ICMP echo request or reply message body. -func parseEcho(proto int, b []byte) (MessageBody, error) { +func parseEcho(proto int, _ Type, b []byte) (MessageBody, error) { bodyLen := len(b) if bodyLen < 4 { return nil, errMessageTooShort @@ -43,3 +43,115 @@ func parseEcho(proto int, b []byte) (MessageBody, error) { } return p, nil } + +// An ExtendedEchoRequest represents an ICMP extended echo request +// message body. +type ExtendedEchoRequest struct { + ID int // identifier + Seq int // sequence number + Local bool // must be true when identifying by name or index + Extensions []Extension // extensions +} + +// Len implements the Len method of MessageBody interface. +func (p *ExtendedEchoRequest) Len(proto int) int { + if p == nil { + return 0 + } + l, _ := multipartMessageBodyDataLen(proto, false, nil, p.Extensions) + return 4 + l +} + +// Marshal implements the Marshal method of MessageBody interface. +func (p *ExtendedEchoRequest) Marshal(proto int) ([]byte, error) { + b, err := marshalMultipartMessageBody(proto, false, nil, p.Extensions) + if err != nil { + return nil, err + } + bb := make([]byte, 4) + binary.BigEndian.PutUint16(bb[:2], uint16(p.ID)) + bb[2] = byte(p.Seq) + if p.Local { + bb[3] |= 0x01 + } + bb = append(bb, b...) + return bb, nil +} + +// parseExtendedEchoRequest parses b as an ICMP extended echo request +// message body. +func parseExtendedEchoRequest(proto int, typ Type, b []byte) (MessageBody, error) { + if len(b) < 4+4 { + return nil, errMessageTooShort + } + p := &ExtendedEchoRequest{ID: int(binary.BigEndian.Uint16(b[:2])), Seq: int(b[2])} + if b[3]&0x01 != 0 { + p.Local = true + } + var err error + _, p.Extensions, err = parseMultipartMessageBody(proto, typ, b[4:]) + if err != nil { + return nil, err + } + return p, nil +} + +// An ExtendedEchoReply represents an ICMP extended echo reply message +// body. +type ExtendedEchoReply struct { + ID int // identifier + Seq int // sequence number + State int // 3-bit state working together with Message.Code + Active bool // probed interface is active + IPv4 bool // probed interface runs IPv4 + IPv6 bool // probed interface runs IPv6 +} + +// Len implements the Len method of MessageBody interface. +func (p *ExtendedEchoReply) Len(proto int) int { + if p == nil { + return 0 + } + return 4 +} + +// Marshal implements the Marshal method of MessageBody interface. +func (p *ExtendedEchoReply) Marshal(proto int) ([]byte, error) { + b := make([]byte, 4) + binary.BigEndian.PutUint16(b[:2], uint16(p.ID)) + b[2] = byte(p.Seq) + b[3] = byte(p.State<<5) & 0xe0 + if p.Active { + b[3] |= 0x04 + } + if p.IPv4 { + b[3] |= 0x02 + } + if p.IPv6 { + b[3] |= 0x01 + } + return b, nil +} + +// parseExtendedEchoReply parses b as an ICMP extended echo reply +// message body. +func parseExtendedEchoReply(proto int, _ Type, b []byte) (MessageBody, error) { + if len(b) < 4 { + return nil, errMessageTooShort + } + p := &ExtendedEchoReply{ + ID: int(binary.BigEndian.Uint16(b[:2])), + Seq: int(b[2]), + State: int(b[3]) >> 5, + } + if b[3]&0x04 != 0 { + p.Active = true + } + if b[3]&0x02 != 0 { + p.IPv4 = true + } + if b[3]&0x01 != 0 { + p.IPv6 = true + } + return p, nil +} diff --git a/cmd/vendor/golang.org/x/net/icmp/extension.go b/cmd/vendor/golang.org/x/net/icmp/extension.go index 402a7514b0..200506855e 100644 --- a/cmd/vendor/golang.org/x/net/icmp/extension.go +++ b/cmd/vendor/golang.org/x/net/icmp/extension.go @@ -4,7 +4,12 @@ package icmp -import "encoding/binary" +import ( + "encoding/binary" + + "golang.org/x/net/ipv4" + "golang.org/x/net/ipv6" +) // An Extension represents an ICMP extension. type Extension interface { @@ -38,7 +43,7 @@ func validExtensionHeader(b []byte) bool { // It will return a list of ICMP extensions and an adjusted length // attribute that represents the length of the padded original // datagram field. Otherwise, it returns an error. -func parseExtensions(b []byte, l int) ([]Extension, int, error) { +func parseExtensions(typ Type, b []byte, l int) ([]Extension, int, error) { // Still a lot of non-RFC 4884 compliant implementations are // out there. Set the length attribute l to 128 when it looks // inappropriate for backwards compatibility. @@ -48,20 +53,28 @@ func parseExtensions(b []byte, l int) ([]Extension, int, error) { // header. // // See RFC 4884 for further information. - if 128 > l || l+8 > len(b) { - l = 128 - } - if l+8 > len(b) { - return nil, -1, errNoExtension - } - if !validExtensionHeader(b[l:]) { - if l == 128 { + switch typ { + case ipv4.ICMPTypeExtendedEchoRequest, ipv6.ICMPTypeExtendedEchoRequest: + if len(b) < 8 || !validExtensionHeader(b) { return nil, -1, errNoExtension } - l = 128 - if !validExtensionHeader(b[l:]) { + l = 0 + default: + if 128 > l || l+8 > len(b) { + l = 128 + } + if l+8 > len(b) { return nil, -1, errNoExtension } + if !validExtensionHeader(b[l:]) { + if l == 128 { + return nil, -1, errNoExtension + } + l = 128 + if !validExtensionHeader(b[l:]) { + return nil, -1, errNoExtension + } + } } var exts []Extension for b = b[l+4:]; len(b) >= 4; { @@ -82,6 +95,12 @@ func parseExtensions(b []byte, l int) ([]Extension, int, error) { return nil, -1, err } exts = append(exts, ext) + case classInterfaceIdent: + ext, err := parseInterfaceIdent(b[:ol]) + if err != nil { + return nil, -1, err + } + exts = append(exts, ext) } b = b[ol:] } diff --git a/cmd/vendor/golang.org/x/net/icmp/interface.go b/cmd/vendor/golang.org/x/net/icmp/interface.go index 78b5b98bf9..617f757b99 100644 --- a/cmd/vendor/golang.org/x/net/icmp/interface.go +++ b/cmd/vendor/golang.org/x/net/icmp/interface.go @@ -14,9 +14,6 @@ import ( const ( classInterfaceInfo = 2 - - afiIPv4 = 1 - afiIPv6 = 2 ) const ( @@ -127,11 +124,11 @@ func (ifi *InterfaceInfo) parseIfIndex(b []byte) ([]byte, error) { func (ifi *InterfaceInfo) marshalIPAddr(proto int, b []byte) []byte { switch proto { case iana.ProtocolICMP: - binary.BigEndian.PutUint16(b[:2], uint16(afiIPv4)) + binary.BigEndian.PutUint16(b[:2], uint16(iana.AddrFamilyIPv4)) copy(b[4:4+net.IPv4len], ifi.Addr.IP.To4()) b = b[4+net.IPv4len:] case iana.ProtocolIPv6ICMP: - binary.BigEndian.PutUint16(b[:2], uint16(afiIPv6)) + binary.BigEndian.PutUint16(b[:2], uint16(iana.AddrFamilyIPv6)) copy(b[4:4+net.IPv6len], ifi.Addr.IP.To16()) b = b[4+net.IPv6len:] } @@ -145,14 +142,14 @@ func (ifi *InterfaceInfo) parseIPAddr(b []byte) ([]byte, error) { afi := int(binary.BigEndian.Uint16(b[:2])) b = b[4:] switch afi { - case afiIPv4: + case iana.AddrFamilyIPv4: if len(b) < net.IPv4len { return nil, errMessageTooShort } ifi.Addr.IP = make(net.IP, net.IPv4len) copy(ifi.Addr.IP, b[:net.IPv4len]) b = b[net.IPv4len:] - case afiIPv6: + case iana.AddrFamilyIPv6: if len(b) < net.IPv6len { return nil, errMessageTooShort } @@ -234,3 +231,92 @@ func parseInterfaceInfo(b []byte) (Extension, error) { } return ifi, nil } + +const ( + classInterfaceIdent = 3 + typeInterfaceByName = 1 + typeInterfaceByIndex = 2 + typeInterfaceByAddress = 3 +) + +// An InterfaceIdent represents interface identification. +type InterfaceIdent struct { + Class int // extension object class number + Type int // extension object sub-type + Name string // interface name + Index int // interface index + AFI int // address family identifier; see address family numbers in IANA registry + Addr []byte // address +} + +// Len implements the Len method of Extension interface. +func (ifi *InterfaceIdent) Len(_ int) int { + switch ifi.Type { + case typeInterfaceByName: + l := len(ifi.Name) + if l > 255 { + l = 255 + } + return 4 + (l+3)&^3 + case typeInterfaceByIndex: + return 4 + 8 + case typeInterfaceByAddress: + return 4 + 4 + (len(ifi.Addr)+3)&^3 + default: + return 4 + } +} + +// Marshal implements the Marshal method of Extension interface. +func (ifi *InterfaceIdent) Marshal(proto int) ([]byte, error) { + b := make([]byte, ifi.Len(proto)) + if err := ifi.marshal(proto, b); err != nil { + return nil, err + } + return b, nil +} + +func (ifi *InterfaceIdent) marshal(proto int, b []byte) error { + l := ifi.Len(proto) + binary.BigEndian.PutUint16(b[:2], uint16(l)) + b[2], b[3] = classInterfaceIdent, byte(ifi.Type) + switch ifi.Type { + case typeInterfaceByName: + copy(b[4:], ifi.Name) + case typeInterfaceByIndex: + binary.BigEndian.PutUint64(b[4:4+8], uint64(ifi.Index)) + case typeInterfaceByAddress: + binary.BigEndian.PutUint16(b[4:4+2], uint16(ifi.AFI)) + b[4+2] = byte(len(ifi.Addr)) + copy(b[4+4:], ifi.Addr) + } + return nil +} + +func parseInterfaceIdent(b []byte) (Extension, error) { + ifi := &InterfaceIdent{ + Class: int(b[2]), + Type: int(b[3]), + } + switch ifi.Type { + case typeInterfaceByName: + ifi.Name = strings.Trim(string(b[4:]), string(0)) + case typeInterfaceByIndex: + if len(b[4:]) < 8 { + return nil, errInvalidExtension + } + ifi.Index = int(binary.BigEndian.Uint64(b[4 : 4+8])) + case typeInterfaceByAddress: + if len(b[4:]) < 4 { + return nil, errInvalidExtension + } + ifi.AFI = int(binary.BigEndian.Uint16(b[4 : 4+2])) + l := int(b[4+2]) + if len(b[4+4:]) < l { + return nil, errInvalidExtension + } + ifi.Addr = make([]byte, l) + copy(ifi.Addr, b[4+4:]) + } + return ifi, nil +} diff --git a/cmd/vendor/golang.org/x/net/icmp/message.go b/cmd/vendor/golang.org/x/net/icmp/message.go index 81140b0df6..46fe95ab04 100644 --- a/cmd/vendor/golang.org/x/net/icmp/message.go +++ b/cmd/vendor/golang.org/x/net/icmp/message.go @@ -11,6 +11,7 @@ // ICMP extensions for MPLS are defined in RFC 4950. // ICMP extensions for interface and next-hop identification are // defined in RFC 5837. +// PROBE: A utility for probing interfaces is defined in RFC 8335. package icmp // import "golang.org/x/net/icmp" import ( @@ -107,21 +108,25 @@ func (m *Message) Marshal(psh []byte) ([]byte, error) { return b[len(psh):], nil } -var parseFns = map[Type]func(int, []byte) (MessageBody, error){ +var parseFns = map[Type]func(int, Type, []byte) (MessageBody, error){ ipv4.ICMPTypeDestinationUnreachable: parseDstUnreach, ipv4.ICMPTypeTimeExceeded: parseTimeExceeded, ipv4.ICMPTypeParameterProblem: parseParamProb, - ipv4.ICMPTypeEcho: parseEcho, - ipv4.ICMPTypeEchoReply: parseEcho, + ipv4.ICMPTypeEcho: parseEcho, + ipv4.ICMPTypeEchoReply: parseEcho, + ipv4.ICMPTypeExtendedEchoRequest: parseExtendedEchoRequest, + ipv4.ICMPTypeExtendedEchoReply: parseExtendedEchoReply, ipv6.ICMPTypeDestinationUnreachable: parseDstUnreach, ipv6.ICMPTypePacketTooBig: parsePacketTooBig, ipv6.ICMPTypeTimeExceeded: parseTimeExceeded, ipv6.ICMPTypeParameterProblem: parseParamProb, - ipv6.ICMPTypeEchoRequest: parseEcho, - ipv6.ICMPTypeEchoReply: parseEcho, + ipv6.ICMPTypeEchoRequest: parseEcho, + ipv6.ICMPTypeEchoReply: parseEcho, + ipv6.ICMPTypeExtendedEchoRequest: parseExtendedEchoRequest, + ipv6.ICMPTypeExtendedEchoReply: parseExtendedEchoReply, } // ParseMessage parses b as an ICMP message. @@ -143,7 +148,7 @@ func ParseMessage(proto int, b []byte) (*Message, error) { if fn, ok := parseFns[m.Type]; !ok { m.Body, err = parseDefaultMessageBody(proto, b[4:]) } else { - m.Body, err = fn(proto, b[4:]) + m.Body, err = fn(proto, m.Type, b[4:]) } if err != nil { return nil, err diff --git a/cmd/vendor/golang.org/x/net/icmp/multipart.go b/cmd/vendor/golang.org/x/net/icmp/multipart.go index f271356606..9ebbbafe9b 100644 --- a/cmd/vendor/golang.org/x/net/icmp/multipart.go +++ b/cmd/vendor/golang.org/x/net/icmp/multipart.go @@ -10,12 +10,14 @@ import "golang.org/x/net/internal/iana" // exts as extensions, and returns a required length for message body // and a required length for a padded original datagram in wire // format. -func multipartMessageBodyDataLen(proto int, b []byte, exts []Extension) (bodyLen, dataLen int) { +func multipartMessageBodyDataLen(proto int, withOrigDgram bool, b []byte, exts []Extension) (bodyLen, dataLen int) { for _, ext := range exts { bodyLen += ext.Len(proto) } if bodyLen > 0 { - dataLen = multipartMessageOrigDatagramLen(proto, b) + if withOrigDgram { + dataLen = multipartMessageOrigDatagramLen(proto, b) + } bodyLen += 4 // length of extension header } else { dataLen = len(b) @@ -50,8 +52,8 @@ func multipartMessageOrigDatagramLen(proto int, b []byte) int { // marshalMultipartMessageBody takes data as an original datagram and // exts as extesnsions, and returns a binary encoding of message body. // It can be used for non-multipart message bodies when exts is nil. -func marshalMultipartMessageBody(proto int, data []byte, exts []Extension) ([]byte, error) { - bodyLen, dataLen := multipartMessageBodyDataLen(proto, data, exts) +func marshalMultipartMessageBody(proto int, withOrigDgram bool, data []byte, exts []Extension) ([]byte, error) { + bodyLen, dataLen := multipartMessageBodyDataLen(proto, withOrigDgram, data, exts) b := make([]byte, 4+bodyLen) copy(b[4:], data) off := dataLen + 4 @@ -71,16 +73,23 @@ func marshalMultipartMessageBody(proto int, data []byte, exts []Extension) ([]by return nil, err } off += ext.Len(proto) + case *InterfaceIdent: + if err := ext.marshal(proto, b[off:]); err != nil { + return nil, err + } + off += ext.Len(proto) } } s := checksum(b[dataLen+4:]) b[dataLen+4+2] ^= byte(s) b[dataLen+4+3] ^= byte(s >> 8) - switch proto { - case iana.ProtocolICMP: - b[1] = byte(dataLen / 4) - case iana.ProtocolIPv6ICMP: - b[0] = byte(dataLen / 8) + if withOrigDgram { + switch proto { + case iana.ProtocolICMP: + b[1] = byte(dataLen / 4) + case iana.ProtocolIPv6ICMP: + b[0] = byte(dataLen / 8) + } } } return b, nil @@ -88,7 +97,7 @@ func marshalMultipartMessageBody(proto int, data []byte, exts []Extension) ([]by // parseMultipartMessageBody parses b as either a non-multipart // message body or a multipart message body. -func parseMultipartMessageBody(proto int, b []byte) ([]byte, []Extension, error) { +func parseMultipartMessageBody(proto int, typ Type, b []byte) ([]byte, []Extension, error) { var l int switch proto { case iana.ProtocolICMP: @@ -99,11 +108,14 @@ func parseMultipartMessageBody(proto int, b []byte) ([]byte, []Extension, error) if len(b) == 4 { return nil, nil, nil } - exts, l, err := parseExtensions(b[4:], l) + exts, l, err := parseExtensions(typ, b[4:], l) if err != nil { l = len(b) - 4 } - data := make([]byte, l) - copy(data, b[4:]) + var data []byte + if l > 0 { + data = make([]byte, l) + copy(data, b[4:]) + } return data, exts, nil } diff --git a/cmd/vendor/golang.org/x/net/icmp/packettoobig.go b/cmd/vendor/golang.org/x/net/icmp/packettoobig.go index a1c9df7bff..afbf24f1ba 100644 --- a/cmd/vendor/golang.org/x/net/icmp/packettoobig.go +++ b/cmd/vendor/golang.org/x/net/icmp/packettoobig.go @@ -29,7 +29,7 @@ func (p *PacketTooBig) Marshal(proto int) ([]byte, error) { } // parsePacketTooBig parses b as an ICMP packet too big message body. -func parsePacketTooBig(proto int, b []byte) (MessageBody, error) { +func parsePacketTooBig(proto int, _ Type, b []byte) (MessageBody, error) { bodyLen := len(b) if bodyLen < 4 { return nil, errMessageTooShort diff --git a/cmd/vendor/golang.org/x/net/icmp/paramprob.go b/cmd/vendor/golang.org/x/net/icmp/paramprob.go index 0a2548daae..85872554fd 100644 --- a/cmd/vendor/golang.org/x/net/icmp/paramprob.go +++ b/cmd/vendor/golang.org/x/net/icmp/paramprob.go @@ -21,7 +21,7 @@ func (p *ParamProb) Len(proto int) int { if p == nil { return 0 } - l, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions) + l, _ := multipartMessageBodyDataLen(proto, true, p.Data, p.Extensions) return 4 + l } @@ -33,7 +33,7 @@ func (p *ParamProb) Marshal(proto int) ([]byte, error) { copy(b[4:], p.Data) return b, nil } - b, err := marshalMultipartMessageBody(proto, p.Data, p.Extensions) + b, err := marshalMultipartMessageBody(proto, true, p.Data, p.Extensions) if err != nil { return nil, err } @@ -42,7 +42,7 @@ func (p *ParamProb) Marshal(proto int) ([]byte, error) { } // parseParamProb parses b as an ICMP parameter problem message body. -func parseParamProb(proto int, b []byte) (MessageBody, error) { +func parseParamProb(proto int, typ Type, b []byte) (MessageBody, error) { if len(b) < 4 { return nil, errMessageTooShort } @@ -55,7 +55,7 @@ func parseParamProb(proto int, b []byte) (MessageBody, error) { } p.Pointer = uintptr(b[0]) var err error - p.Data, p.Extensions, err = parseMultipartMessageBody(proto, b) + p.Data, p.Extensions, err = parseMultipartMessageBody(proto, typ, b) if err != nil { return nil, err } diff --git a/cmd/vendor/golang.org/x/net/icmp/timeexceeded.go b/cmd/vendor/golang.org/x/net/icmp/timeexceeded.go index 344e15848d..14e9e23ccd 100644 --- a/cmd/vendor/golang.org/x/net/icmp/timeexceeded.go +++ b/cmd/vendor/golang.org/x/net/icmp/timeexceeded.go @@ -15,23 +15,23 @@ func (p *TimeExceeded) Len(proto int) int { if p == nil { return 0 } - l, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions) + l, _ := multipartMessageBodyDataLen(proto, true, p.Data, p.Extensions) return 4 + l } // Marshal implements the Marshal method of MessageBody interface. func (p *TimeExceeded) Marshal(proto int) ([]byte, error) { - return marshalMultipartMessageBody(proto, p.Data, p.Extensions) + return marshalMultipartMessageBody(proto, true, p.Data, p.Extensions) } // parseTimeExceeded parses b as an ICMP time exceeded message body. -func parseTimeExceeded(proto int, b []byte) (MessageBody, error) { +func parseTimeExceeded(proto int, typ Type, b []byte) (MessageBody, error) { if len(b) < 4 { return nil, errMessageTooShort } p := &TimeExceeded{} var err error - p.Data, p.Extensions, err = parseMultipartMessageBody(proto, b) + p.Data, p.Extensions, err = parseMultipartMessageBody(proto, typ, b) if err != nil { return nil, err } diff --git a/cmd/vendor/golang.org/x/net/internal/iana/const.go b/cmd/vendor/golang.org/x/net/internal/iana/const.go index c9df24d95f..826633e1b8 100644 --- a/cmd/vendor/golang.org/x/net/internal/iana/const.go +++ b/cmd/vendor/golang.org/x/net/internal/iana/const.go @@ -1,5 +1,5 @@ // go generate gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Code generated by the command above; DO NOT EDIT. // Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). package iana // import "golang.org/x/net/internal/iana" @@ -38,7 +38,7 @@ const ( CongestionExperienced = 0x3 // CE (Congestion Experienced) ) -// Protocol Numbers, Updated: 2016-06-22 +// Protocol Numbers, Updated: 2017-10-13 const ( ProtocolIP = 0 // IPv4 encapsulation, pseudo protocol number ProtocolHOPOPT = 0 // IPv6 Hop-by-Hop Option @@ -178,3 +178,50 @@ const ( ProtocolROHC = 142 // Robust Header Compression ProtocolReserved = 255 // Reserved ) + +// Address Family Numbers, Updated: 2016-10-25 +const ( + AddrFamilyIPv4 = 1 // IP (IP version 4) + AddrFamilyIPv6 = 2 // IP6 (IP version 6) + AddrFamilyNSAP = 3 // NSAP + AddrFamilyHDLC = 4 // HDLC (8-bit multidrop) + AddrFamilyBBN1822 = 5 // BBN 1822 + AddrFamily802 = 6 // 802 (includes all 802 media plus Ethernet "canonical format") + AddrFamilyE163 = 7 // E.163 + AddrFamilyE164 = 8 // E.164 (SMDS, Frame Relay, ATM) + AddrFamilyF69 = 9 // F.69 (Telex) + AddrFamilyX121 = 10 // X.121 (X.25, Frame Relay) + AddrFamilyIPX = 11 // IPX + AddrFamilyAppletalk = 12 // Appletalk + AddrFamilyDecnetIV = 13 // Decnet IV + AddrFamilyBanyanVines = 14 // Banyan Vines + AddrFamilyE164withSubaddress = 15 // E.164 with NSAP format subaddress + AddrFamilyDNS = 16 // DNS (Domain Name System) + AddrFamilyDistinguishedName = 17 // Distinguished Name + AddrFamilyASNumber = 18 // AS Number + AddrFamilyXTPoverIPv4 = 19 // XTP over IP version 4 + AddrFamilyXTPoverIPv6 = 20 // XTP over IP version 6 + AddrFamilyXTPnativemodeXTP = 21 // XTP native mode XTP + AddrFamilyFibreChannelWorldWidePortName = 22 // Fibre Channel World-Wide Port Name + AddrFamilyFibreChannelWorldWideNodeName = 23 // Fibre Channel World-Wide Node Name + AddrFamilyGWID = 24 // GWID + AddrFamilyL2VPN = 25 // AFI for L2VPN information + AddrFamilyMPLSTPSectionEndpointID = 26 // MPLS-TP Section Endpoint Identifier + AddrFamilyMPLSTPLSPEndpointID = 27 // MPLS-TP LSP Endpoint Identifier + AddrFamilyMPLSTPPseudowireEndpointID = 28 // MPLS-TP Pseudowire Endpoint Identifier + AddrFamilyMTIPv4 = 29 // MT IP: Multi-Topology IP version 4 + AddrFamilyMTIPv6 = 30 // MT IPv6: Multi-Topology IP version 6 + AddrFamilyEIGRPCommonServiceFamily = 16384 // EIGRP Common Service Family + AddrFamilyEIGRPIPv4ServiceFamily = 16385 // EIGRP IPv4 Service Family + AddrFamilyEIGRPIPv6ServiceFamily = 16386 // EIGRP IPv6 Service Family + AddrFamilyLISPCanonicalAddressFormat = 16387 // LISP Canonical Address Format (LCAF) + AddrFamilyBGPLS = 16388 // BGP-LS + AddrFamily48bitMAC = 16389 // 48-bit MAC + AddrFamily64bitMAC = 16390 // 64-bit MAC + AddrFamilyOUI = 16391 // OUI + AddrFamilyMACFinal24bits = 16392 // MAC/24 + AddrFamilyMACFinal40bits = 16393 // MAC/40 + AddrFamilyIPv6Initial64bits = 16394 // IPv6/64 + AddrFamilyRBridgePortID = 16395 // RBridge Port ID + AddrFamilyTRILLNickname = 16396 // TRILL Nickname +) diff --git a/cmd/vendor/golang.org/x/net/internal/iana/gen.go b/cmd/vendor/golang.org/x/net/internal/iana/gen.go index 2a5c310c2f..2227e09e89 100644 --- a/cmd/vendor/golang.org/x/net/internal/iana/gen.go +++ b/cmd/vendor/golang.org/x/net/internal/iana/gen.go @@ -39,12 +39,16 @@ var registries = []struct { "https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", parseProtocolNumbers, }, + { + "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml", + parseAddrFamilyNumbers, + }, } func main() { var bb bytes.Buffer fmt.Fprintf(&bb, "// go generate gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") + fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n") fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n") fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n") for _, r := range registries { @@ -291,3 +295,93 @@ func (pn *protocolNumbers) escape() []canonProtocolRecord { } return prs } + +func parseAddrFamilyNumbers(w io.Writer, r io.Reader) error { + dec := xml.NewDecoder(r) + var afn addrFamilylNumbers + if err := dec.Decode(&afn); err != nil { + return err + } + afrs := afn.escape() + fmt.Fprintf(w, "// %s, Updated: %s\n", afn.Title, afn.Updated) + fmt.Fprintf(w, "const (\n") + for _, afr := range afrs { + if afr.Name == "" { + continue + } + fmt.Fprintf(w, "AddrFamily%s = %d", afr.Name, afr.Value) + fmt.Fprintf(w, "// %s\n", afr.Descr) + } + fmt.Fprintf(w, ")\n") + return nil +} + +type addrFamilylNumbers struct { + XMLName xml.Name `xml:"registry"` + Title string `xml:"title"` + Updated string `xml:"updated"` + RegTitle string `xml:"registry>title"` + Note string `xml:"registry>note"` + Records []struct { + Value string `xml:"value"` + Descr string `xml:"description"` + } `xml:"registry>record"` +} + +type canonAddrFamilyRecord struct { + Name string + Descr string + Value int +} + +func (afn *addrFamilylNumbers) escape() []canonAddrFamilyRecord { + afrs := make([]canonAddrFamilyRecord, len(afn.Records)) + sr := strings.NewReplacer( + "IP version 4", "IPv4", + "IP version 6", "IPv6", + "Identifier", "ID", + "-", "", + "-", "", + "/", "", + ".", "", + " ", "", + ) + for i, afr := range afn.Records { + if strings.Contains(afr.Descr, "Unassigned") || + strings.Contains(afr.Descr, "Reserved") { + continue + } + afrs[i].Descr = afr.Descr + s := strings.TrimSpace(afr.Descr) + switch s { + case "IP (IP version 4)": + afrs[i].Name = "IPv4" + case "IP6 (IP version 6)": + afrs[i].Name = "IPv6" + case "AFI for L2VPN information": + afrs[i].Name = "L2VPN" + case "E.164 with NSAP format subaddress": + afrs[i].Name = "E164withSubaddress" + case "MT IP: Multi-Topology IP version 4": + afrs[i].Name = "MTIPv4" + case "MAC/24": + afrs[i].Name = "MACFinal24bits" + case "MAC/40": + afrs[i].Name = "MACFinal40bits" + case "IPv6/64": + afrs[i].Name = "IPv6Initial64bits" + default: + n := strings.Index(s, "(") + if n > 0 { + s = s[:n] + } + n = strings.Index(s, ":") + if n > 0 { + s = s[:n] + } + afrs[i].Name = sr.Replace(s) + } + afrs[i].Value, _ = strconv.Atoi(afr.Value) + } + return afrs +} diff --git a/cmd/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go b/cmd/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go index 206ea2d115..db60491fe3 100644 --- a/cmd/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go +++ b/cmd/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go @@ -26,6 +26,11 @@ type msghdr struct { Flags int32 } +type mmsghdr struct { + Hdr msghdr + Len uint32 +} + type cmsghdr struct { Len uint32 Level int32 @@ -52,6 +57,7 @@ type sockaddrInet6 struct { const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c + sizeofMmsghdr = 0x20 sizeofCmsghdr = 0xc sizeofSockaddrInet = 0x10 diff --git a/cmd/vendor/golang.org/x/net/internal/socks/client.go b/cmd/vendor/golang.org/x/net/internal/socks/client.go new file mode 100644 index 0000000000..3d6f516a59 --- /dev/null +++ b/cmd/vendor/golang.org/x/net/internal/socks/client.go @@ -0,0 +1,168 @@ +// 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 socks + +import ( + "context" + "errors" + "io" + "net" + "strconv" + "time" +) + +var ( + noDeadline = time.Time{} + aLongTimeAgo = time.Unix(1, 0) +) + +func (d *Dialer) connect(ctx context.Context, c net.Conn, address string) (_ net.Addr, ctxErr error) { + host, port, err := splitHostPort(address) + if err != nil { + return nil, err + } + if deadline, ok := ctx.Deadline(); ok && !deadline.IsZero() { + c.SetDeadline(deadline) + defer c.SetDeadline(noDeadline) + } + if ctx != context.Background() { + errCh := make(chan error, 1) + done := make(chan struct{}) + defer func() { + close(done) + if ctxErr == nil { + ctxErr = <-errCh + } + }() + go func() { + select { + case <-ctx.Done(): + c.SetDeadline(aLongTimeAgo) + errCh <- ctx.Err() + case <-done: + errCh <- nil + } + }() + } + + b := make([]byte, 0, 6+len(host)) // the size here is just an estimate + b = append(b, Version5) + if len(d.AuthMethods) == 0 || d.Authenticate == nil { + b = append(b, 1, byte(AuthMethodNotRequired)) + } else { + ams := d.AuthMethods + if len(ams) > 255 { + return nil, errors.New("too many authentication methods") + } + b = append(b, byte(len(ams))) + for _, am := range ams { + b = append(b, byte(am)) + } + } + if _, ctxErr = c.Write(b); ctxErr != nil { + return + } + + if _, ctxErr = io.ReadFull(c, b[:2]); ctxErr != nil { + return + } + if b[0] != Version5 { + return nil, errors.New("unexpected protocol version " + strconv.Itoa(int(b[0]))) + } + am := AuthMethod(b[1]) + if am == AuthMethodNoAcceptableMethods { + return nil, errors.New("no acceptable authentication methods") + } + if d.Authenticate != nil { + if ctxErr = d.Authenticate(ctx, c, am); ctxErr != nil { + return + } + } + + b = b[:0] + b = append(b, Version5, byte(d.cmd), 0) + if ip := net.ParseIP(host); ip != nil { + if ip4 := ip.To4(); ip4 != nil { + b = append(b, AddrTypeIPv4) + b = append(b, ip4...) + } else if ip6 := ip.To16(); ip6 != nil { + b = append(b, AddrTypeIPv6) + b = append(b, ip6...) + } else { + return nil, errors.New("unknown address type") + } + } else { + if len(host) > 255 { + return nil, errors.New("FQDN too long") + } + b = append(b, AddrTypeFQDN) + b = append(b, byte(len(host))) + b = append(b, host...) + } + b = append(b, byte(port>>8), byte(port)) + if _, ctxErr = c.Write(b); ctxErr != nil { + return + } + + if _, ctxErr = io.ReadFull(c, b[:4]); ctxErr != nil { + return + } + if b[0] != Version5 { + return nil, errors.New("unexpected protocol version " + strconv.Itoa(int(b[0]))) + } + if cmdErr := Reply(b[1]); cmdErr != StatusSucceeded { + return nil, errors.New("unknown error " + cmdErr.String()) + } + if b[2] != 0 { + return nil, errors.New("non-zero reserved field") + } + l := 2 + var a Addr + switch b[3] { + case AddrTypeIPv4: + l += net.IPv4len + a.IP = make(net.IP, net.IPv4len) + case AddrTypeIPv6: + l += net.IPv6len + a.IP = make(net.IP, net.IPv6len) + case AddrTypeFQDN: + if _, err := io.ReadFull(c, b[:1]); err != nil { + return nil, err + } + l += int(b[0]) + default: + return nil, errors.New("unknown address type " + strconv.Itoa(int(b[3]))) + } + if cap(b) < l { + b = make([]byte, l) + } else { + b = b[:l] + } + if _, ctxErr = io.ReadFull(c, b); ctxErr != nil { + return + } + if a.IP != nil { + copy(a.IP, b) + } else { + a.Name = string(b[:len(b)-2]) + } + a.Port = int(b[len(b)-2])<<8 | int(b[len(b)-1]) + return &a, nil +} + +func splitHostPort(address string) (string, int, error) { + host, port, err := net.SplitHostPort(address) + if err != nil { + return "", 0, err + } + portnum, err := strconv.Atoi(port) + if err != nil { + return "", 0, err + } + if 1 > portnum || portnum > 0xffff { + return "", 0, errors.New("port number out of range " + port) + } + return host, portnum, nil +} diff --git a/cmd/vendor/golang.org/x/net/internal/socks/socks.go b/cmd/vendor/golang.org/x/net/internal/socks/socks.go new file mode 100644 index 0000000000..9158595366 --- /dev/null +++ b/cmd/vendor/golang.org/x/net/internal/socks/socks.go @@ -0,0 +1,265 @@ +// 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 socks provides a SOCKS version 5 client implementation. +// +// SOCKS protocol version 5 is defined in RFC 1928. +// Username/Password authentication for SOCKS version 5 is defined in +// RFC 1929. +package socks + +import ( + "context" + "errors" + "io" + "net" + "strconv" +) + +// A Command represents a SOCKS command. +type Command int + +func (cmd Command) String() string { + switch cmd { + case CmdConnect: + return "socks connect" + case cmdBind: + return "socks bind" + default: + return "socks " + strconv.Itoa(int(cmd)) + } +} + +// An AuthMethod represents a SOCKS authentication method. +type AuthMethod int + +// A Reply represents a SOCKS command reply code. +type Reply int + +func (code Reply) String() string { + switch code { + case StatusSucceeded: + return "succeeded" + case 0x01: + return "general SOCKS server failure" + case 0x02: + return "connection not allowed by ruleset" + case 0x03: + return "network unreachable" + case 0x04: + return "host unreachable" + case 0x05: + return "connection refused" + case 0x06: + return "TTL expired" + case 0x07: + return "command not supported" + case 0x08: + return "address type not supported" + default: + return "unknown code: " + strconv.Itoa(int(code)) + } +} + +// Wire protocol constants. +const ( + Version5 = 0x05 + + AddrTypeIPv4 = 0x01 + AddrTypeFQDN = 0x03 + AddrTypeIPv6 = 0x04 + + CmdConnect Command = 0x01 // establishes an active-open forward proxy connection + cmdBind Command = 0x02 // establishes a passive-open forward proxy connection + + AuthMethodNotRequired AuthMethod = 0x00 // no authentication required + AuthMethodUsernamePassword AuthMethod = 0x02 // use username/password + AuthMethodNoAcceptableMethods AuthMethod = 0xff // no acceptable authetication methods + + StatusSucceeded Reply = 0x00 +) + +// An Addr represents a SOCKS-specific address. +// Either Name or IP is used exclusively. +type Addr struct { + Name string // fully-qualified domain name + IP net.IP + Port int +} + +func (a *Addr) Network() string { return "socks" } + +func (a *Addr) String() string { + if a == nil { + return "" + } + port := strconv.Itoa(a.Port) + if a.IP == nil { + return net.JoinHostPort(a.Name, port) + } + return net.JoinHostPort(a.IP.String(), port) +} + +// A Conn represents a forward proxy connection. +type Conn struct { + net.Conn + + boundAddr net.Addr +} + +// BoundAddr returns the address assigned by the proxy server for +// connecting to the command target address from the proxy server. +func (c *Conn) BoundAddr() net.Addr { + if c == nil { + return nil + } + return c.boundAddr +} + +// A Dialer holds SOCKS-specific options. +type Dialer struct { + cmd Command // either CmdConnect or cmdBind + proxyNetwork string // network between a proxy server and a client + proxyAddress string // proxy server address + + // ProxyDial specifies the optional dial function for + // establishing the transport connection. + ProxyDial func(context.Context, string, string) (net.Conn, error) + + // AuthMethods specifies the list of request authention + // methods. + // If empty, SOCKS client requests only AuthMethodNotRequired. + AuthMethods []AuthMethod + + // Authenticate specifies the optional authentication + // function. It must be non-nil when AuthMethods is not empty. + // It must return an error when the authentication is failed. + Authenticate func(context.Context, io.ReadWriter, AuthMethod) error +} + +// DialContext connects to the provided address on the provided +// network. +// +// The returned error value may be a net.OpError. When the Op field of +// net.OpError contains "socks", the Source field contains a proxy +// server address and the Addr field contains a command target +// address. +// +// See func Dial of the net package of standard library for a +// description of the network and address parameters. +func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { + switch network { + case "tcp", "tcp6", "tcp4": + default: + proxy, dst, _ := d.pathAddrs(address) + return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: errors.New("network not implemented")} + } + switch d.cmd { + case CmdConnect, cmdBind: + default: + proxy, dst, _ := d.pathAddrs(address) + return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: errors.New("command not implemented")} + } + if ctx == nil { + ctx = context.Background() + } + var err error + var c net.Conn + if d.ProxyDial != nil { + c, err = d.ProxyDial(ctx, d.proxyNetwork, d.proxyAddress) + } else { + var dd net.Dialer + c, err = dd.DialContext(ctx, d.proxyNetwork, d.proxyAddress) + } + if err != nil { + proxy, dst, _ := d.pathAddrs(address) + return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: err} + } + a, err := d.connect(ctx, c, address) + if err != nil { + c.Close() + proxy, dst, _ := d.pathAddrs(address) + return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: err} + } + return &Conn{Conn: c, boundAddr: a}, nil +} + +// Dial connects to the provided address on the provided network. +// +// Deprecated: Use DialContext instead. +func (d *Dialer) Dial(network, address string) (net.Conn, error) { + return d.DialContext(context.Background(), network, address) +} + +func (d *Dialer) pathAddrs(address string) (proxy, dst net.Addr, err error) { + for i, s := range []string{d.proxyAddress, address} { + host, port, err := splitHostPort(s) + if err != nil { + return nil, nil, err + } + a := &Addr{Port: port} + a.IP = net.ParseIP(host) + if a.IP == nil { + a.Name = host + } + if i == 0 { + proxy = a + } else { + dst = a + } + } + return +} + +// NewDialer returns a new Dialer that dials through the provided +// proxy server's network and address. +func NewDialer(network, address string) *Dialer { + return &Dialer{proxyNetwork: network, proxyAddress: address, cmd: CmdConnect} +} + +const ( + authUsernamePasswordVersion = 0x01 + authStatusSucceeded = 0x00 +) + +// UsernamePassword are the credentials for the username/password +// authentication method. +type UsernamePassword struct { + Username string + Password string +} + +// Authenticate authenticates a pair of username and password with the +// proxy server. +func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter, auth AuthMethod) error { + switch auth { + case AuthMethodNotRequired: + return nil + case AuthMethodUsernamePassword: + if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 { + return errors.New("invalid username/password") + } + b := []byte{authUsernamePasswordVersion} + b = append(b, byte(len(up.Username))) + b = append(b, up.Username...) + b = append(b, byte(len(up.Password))) + b = append(b, up.Password...) + // TODO(mikio): handle IO deadlines and cancelation if + // necessary + if _, err := rw.Write(b); err != nil { + return err + } + if _, err := io.ReadFull(rw, b[:2]); err != nil { + return err + } + if b[0] != authUsernamePasswordVersion { + return errors.New("invalid username/password version") + } + if b[1] != authStatusSucceeded { + return errors.New("username/password authentication failed") + } + return nil + } + return errors.New("unsupported authentication method " + strconv.Itoa(int(auth))) +} diff --git a/cmd/vendor/golang.org/x/net/internal/sockstest/server.go b/cmd/vendor/golang.org/x/net/internal/sockstest/server.go new file mode 100644 index 0000000000..3c6e9e95b4 --- /dev/null +++ b/cmd/vendor/golang.org/x/net/internal/sockstest/server.go @@ -0,0 +1,241 @@ +// 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 sockstest provides utilities for SOCKS testing. +package sockstest + +import ( + "errors" + "io" + "net" + + "golang.org/x/net/internal/nettest" + "golang.org/x/net/internal/socks" +) + +// An AuthRequest represents an authentication request. +type AuthRequest struct { + Version int + Methods []socks.AuthMethod +} + +// ParseAuthRequest parses an authentication request. +func ParseAuthRequest(b []byte) (*AuthRequest, error) { + if len(b) < 2 { + return nil, errors.New("short auth request") + } + if b[0] != socks.Version5 { + return nil, errors.New("unexpected protocol version") + } + if len(b)-2 < int(b[1]) { + return nil, errors.New("short auth request") + } + req := &AuthRequest{Version: int(b[0])} + if b[1] > 0 { + req.Methods = make([]socks.AuthMethod, b[1]) + for i, m := range b[2 : 2+b[1]] { + req.Methods[i] = socks.AuthMethod(m) + } + } + return req, nil +} + +// MarshalAuthReply returns an authentication reply in wire format. +func MarshalAuthReply(ver int, m socks.AuthMethod) ([]byte, error) { + return []byte{byte(ver), byte(m)}, nil +} + +// A CmdRequest repesents a command request. +type CmdRequest struct { + Version int + Cmd socks.Command + Addr socks.Addr +} + +// ParseCmdRequest parses a command request. +func ParseCmdRequest(b []byte) (*CmdRequest, error) { + if len(b) < 7 { + return nil, errors.New("short cmd request") + } + if b[0] != socks.Version5 { + return nil, errors.New("unexpected protocol version") + } + if socks.Command(b[1]) != socks.CmdConnect { + return nil, errors.New("unexpected command") + } + if b[2] != 0 { + return nil, errors.New("non-zero reserved field") + } + req := &CmdRequest{Version: int(b[0]), Cmd: socks.Command(b[1])} + l := 2 + off := 4 + switch b[3] { + case socks.AddrTypeIPv4: + l += net.IPv4len + req.Addr.IP = make(net.IP, net.IPv4len) + case socks.AddrTypeIPv6: + l += net.IPv6len + req.Addr.IP = make(net.IP, net.IPv6len) + case socks.AddrTypeFQDN: + l += int(b[4]) + off = 5 + default: + return nil, errors.New("unknown address type") + } + if len(b[off:]) < l { + return nil, errors.New("short cmd request") + } + if req.Addr.IP != nil { + copy(req.Addr.IP, b[off:]) + } else { + req.Addr.Name = string(b[off : off+l-2]) + } + req.Addr.Port = int(b[off+l-2])<<8 | int(b[off+l-1]) + return req, nil +} + +// MarshalCmdReply returns a command reply in wire format. +func MarshalCmdReply(ver int, reply socks.Reply, a *socks.Addr) ([]byte, error) { + b := make([]byte, 4) + b[0] = byte(ver) + b[1] = byte(reply) + if a.Name != "" { + if len(a.Name) > 255 { + return nil, errors.New("fqdn too long") + } + b[3] = socks.AddrTypeFQDN + b = append(b, byte(len(a.Name))) + b = append(b, a.Name...) + } else if ip4 := a.IP.To4(); ip4 != nil { + b[3] = socks.AddrTypeIPv4 + b = append(b, ip4...) + } else if ip6 := a.IP.To16(); ip6 != nil { + b[3] = socks.AddrTypeIPv6 + b = append(b, ip6...) + } else { + return nil, errors.New("unknown address type") + } + b = append(b, byte(a.Port>>8), byte(a.Port)) + return b, nil +} + +// A Server repesents a server for handshake testing. +type Server struct { + ln net.Listener +} + +// Addr rerurns a server address. +func (s *Server) Addr() net.Addr { + return s.ln.Addr() +} + +// TargetAddr returns a fake final destination address. +// +// The returned address is only valid for testing with Server. +func (s *Server) TargetAddr() net.Addr { + a := s.ln.Addr() + switch a := a.(type) { + case *net.TCPAddr: + if a.IP.To4() != nil { + return &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 5963} + } + if a.IP.To16() != nil && a.IP.To4() == nil { + return &net.TCPAddr{IP: net.IPv6loopback, Port: 5963} + } + } + return nil +} + +// Close closes the server. +func (s *Server) Close() error { + return s.ln.Close() +} + +func (s *Server) serve(authFunc, cmdFunc func(io.ReadWriter, []byte) error) { + c, err := s.ln.Accept() + if err != nil { + return + } + defer c.Close() + go s.serve(authFunc, cmdFunc) + b := make([]byte, 512) + n, err := c.Read(b) + if err != nil { + return + } + if err := authFunc(c, b[:n]); err != nil { + return + } + n, err = c.Read(b) + if err != nil { + return + } + if err := cmdFunc(c, b[:n]); err != nil { + return + } +} + +// NewServer returns a new server. +// +// The provided authFunc and cmdFunc must parse requests and return +// appropriate replies to clients. +func NewServer(authFunc, cmdFunc func(io.ReadWriter, []byte) error) (*Server, error) { + var err error + s := new(Server) + s.ln, err = nettest.NewLocalListener("tcp") + if err != nil { + return nil, err + } + go s.serve(authFunc, cmdFunc) + return s, nil +} + +// NoAuthRequired handles a no-authentication-required signaling. +func NoAuthRequired(rw io.ReadWriter, b []byte) error { + req, err := ParseAuthRequest(b) + if err != nil { + return err + } + b, err = MarshalAuthReply(req.Version, socks.AuthMethodNotRequired) + if err != nil { + return err + } + n, err := rw.Write(b) + if err != nil { + return err + } + if n != len(b) { + return errors.New("short write") + } + return nil +} + +// NoProxyRequired handles a command signaling without constructing a +// proxy connection to the final destination. +func NoProxyRequired(rw io.ReadWriter, b []byte) error { + req, err := ParseCmdRequest(b) + if err != nil { + return err + } + req.Addr.Port += 1 + if req.Addr.Name != "" { + req.Addr.Name = "boundaddr.doesnotexist" + } else if req.Addr.IP.To4() != nil { + req.Addr.IP = net.IPv4(127, 0, 0, 1) + } else { + req.Addr.IP = net.IPv6loopback + } + b, err = MarshalCmdReply(socks.Version5, socks.StatusSucceeded, &req.Addr) + if err != nil { + return err + } + n, err := rw.Write(b) + if err != nil { + return err + } + if n != len(b) { + return errors.New("short write") + } + return nil +} diff --git a/cmd/vendor/golang.org/x/net/ipv4/gen.go b/cmd/vendor/golang.org/x/net/ipv4/gen.go index 9d490fac9d..1bb1737f67 100644 --- a/cmd/vendor/golang.org/x/net/ipv4/gen.go +++ b/cmd/vendor/golang.org/x/net/ipv4/gen.go @@ -80,7 +80,7 @@ var registries = []struct { func geniana() error { var bb bytes.Buffer fmt.Fprintf(&bb, "// go generate gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") + fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n") fmt.Fprintf(&bb, "package ipv4\n\n") for _, r := range registries { resp, err := http.Get(r.url) diff --git a/cmd/vendor/golang.org/x/net/ipv4/iana.go b/cmd/vendor/golang.org/x/net/ipv4/iana.go index be10c94888..4375b4099b 100644 --- a/cmd/vendor/golang.org/x/net/ipv4/iana.go +++ b/cmd/vendor/golang.org/x/net/ipv4/iana.go @@ -1,9 +1,9 @@ // go generate gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Code generated by the command above; DO NOT EDIT. package ipv4 -// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19 +// Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26 const ( ICMPTypeEchoReply ICMPType = 0 // Echo Reply ICMPTypeDestinationUnreachable ICMPType = 3 // Destination Unreachable @@ -16,9 +16,11 @@ const ( ICMPTypeTimestamp ICMPType = 13 // Timestamp ICMPTypeTimestampReply ICMPType = 14 // Timestamp Reply ICMPTypePhoturis ICMPType = 40 // Photuris + ICMPTypeExtendedEchoRequest ICMPType = 42 // Extended Echo Request + ICMPTypeExtendedEchoReply ICMPType = 43 // Extended Echo Reply ) -// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19 +// Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26 var icmpTypes = map[ICMPType]string{ 0: "echo reply", 3: "destination unreachable", @@ -31,4 +33,6 @@ var icmpTypes = map[ICMPType]string{ 13: "timestamp", 14: "timestamp reply", 40: "photuris", + 42: "extended echo request", + 43: "extended echo reply", } diff --git a/cmd/vendor/golang.org/x/net/ipv6/gen.go b/cmd/vendor/golang.org/x/net/ipv6/gen.go index 47b7e9f0a4..5885664fbc 100644 --- a/cmd/vendor/golang.org/x/net/ipv6/gen.go +++ b/cmd/vendor/golang.org/x/net/ipv6/gen.go @@ -80,7 +80,7 @@ var registries = []struct { func geniana() error { var bb bytes.Buffer fmt.Fprintf(&bb, "// go generate gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") + fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n") fmt.Fprintf(&bb, "package ipv6\n\n") for _, r := range registries { resp, err := http.Get(r.url) diff --git a/cmd/vendor/golang.org/x/net/ipv6/iana.go b/cmd/vendor/golang.org/x/net/ipv6/iana.go index 3c6214fb69..32db1aa949 100644 --- a/cmd/vendor/golang.org/x/net/ipv6/iana.go +++ b/cmd/vendor/golang.org/x/net/ipv6/iana.go @@ -1,9 +1,9 @@ // go generate gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Code generated by the command above; DO NOT EDIT. package ipv6 -// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07 +// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09 const ( ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big @@ -40,9 +40,11 @@ const ( ICMPTypeDuplicateAddressRequest ICMPType = 157 // Duplicate Address Request ICMPTypeDuplicateAddressConfirmation ICMPType = 158 // Duplicate Address Confirmation ICMPTypeMPLControl ICMPType = 159 // MPL Control Message + ICMPTypeExtendedEchoRequest ICMPType = 160 // Extended Echo Request + ICMPTypeExtendedEchoReply ICMPType = 161 // Extended Echo Reply ) -// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07 +// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09 var icmpTypes = map[ICMPType]string{ 1: "destination unreachable", 2: "packet too big", @@ -79,4 +81,6 @@ var icmpTypes = map[ICMPType]string{ 157: "duplicate address request", 158: "duplicate address confirmation", 159: "mpl control message", + 160: "extended echo request", + 161: "extended echo reply", } diff --git a/cmd/vendor/golang.org/x/net/netutil/listen.go b/cmd/vendor/golang.org/x/net/netutil/listen.go index 56f43bf65b..cee46e331f 100644 --- a/cmd/vendor/golang.org/x/net/netutil/listen.go +++ b/cmd/vendor/golang.org/x/net/netutil/listen.go @@ -14,27 +14,53 @@ import ( // LimitListener returns a Listener that accepts at most n simultaneous // connections from the provided Listener. func LimitListener(l net.Listener, n int) net.Listener { - return &limitListener{l, make(chan struct{}, n)} + return &limitListener{ + Listener: l, + sem: make(chan struct{}, n), + done: make(chan struct{}), + } } type limitListener struct { net.Listener - sem chan struct{} + sem chan struct{} + closeOnce sync.Once // ensures the done chan is only closed once + done chan struct{} // no values sent; closed when Close is called } -func (l *limitListener) acquire() { l.sem <- struct{}{} } +// acquire acquires the limiting semaphore. Returns true if successfully +// accquired, false if the listener is closed and the semaphore is not +// acquired. +func (l *limitListener) acquire() bool { + select { + case <-l.done: + return false + case l.sem <- struct{}{}: + return true + } +} func (l *limitListener) release() { <-l.sem } func (l *limitListener) Accept() (net.Conn, error) { - l.acquire() + acquired := l.acquire() + // If the semaphore isn't acquired because the listener was closed, expect + // that this call to accept won't block, but immediately return an error. c, err := l.Listener.Accept() if err != nil { - l.release() + if acquired { + l.release() + } return nil, err } return &limitListenerConn{Conn: c, release: l.release}, nil } +func (l *limitListener) Close() error { + err := l.Listener.Close() + l.closeOnce.Do(func() { close(l.done) }) + return err +} + type limitListenerConn struct { net.Conn releaseOnce sync.Once diff --git a/cmd/vendor/golang.org/x/net/proxy/socks5.go b/cmd/vendor/golang.org/x/net/proxy/socks5.go index 3fed38ef1c..56345ec8b6 100644 --- a/cmd/vendor/golang.org/x/net/proxy/socks5.go +++ b/cmd/vendor/golang.org/x/net/proxy/socks5.go @@ -5,210 +5,32 @@ package proxy import ( - "errors" - "io" + "context" "net" - "strconv" -) - -// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address -// with an optional username and password. See RFC 1928 and RFC 1929. -func SOCKS5(network, addr string, auth *Auth, forward Dialer) (Dialer, error) { - s := &socks5{ - network: network, - addr: addr, - forward: forward, - } - if auth != nil { - s.user = auth.User - s.password = auth.Password - } - - return s, nil -} -type socks5 struct { - user, password string - network, addr string - forward Dialer -} - -const socks5Version = 5 - -const ( - socks5AuthNone = 0 - socks5AuthPassword = 2 + "golang.org/x/net/internal/socks" ) -const socks5Connect = 1 - -const ( - socks5IP4 = 1 - socks5Domain = 3 - socks5IP6 = 4 -) - -var socks5Errors = []string{ - "", - "general failure", - "connection forbidden", - "network unreachable", - "host unreachable", - "connection refused", - "TTL expired", - "command not supported", - "address type not supported", -} - -// Dial connects to the address addr on the given network via the SOCKS5 proxy. -func (s *socks5) Dial(network, addr string) (net.Conn, error) { - switch network { - case "tcp", "tcp6", "tcp4": - default: - return nil, errors.New("proxy: no support for SOCKS5 proxy connections of type " + network) - } - - conn, err := s.forward.Dial(s.network, s.addr) - if err != nil { - return nil, err - } - if err := s.connect(conn, addr); err != nil { - conn.Close() - return nil, err - } - return conn, nil -} - -// connect takes an existing connection to a socks5 proxy server, -// and commands the server to extend that connection to target, -// which must be a canonical address with a host and port. -func (s *socks5) connect(conn net.Conn, target string) error { - host, portStr, err := net.SplitHostPort(target) - if err != nil { - return err - } - - port, err := strconv.Atoi(portStr) - if err != nil { - return errors.New("proxy: failed to parse port number: " + portStr) - } - if port < 1 || port > 0xffff { - return errors.New("proxy: port number out of range: " + portStr) - } - - // the size here is just an estimate - buf := make([]byte, 0, 6+len(host)) - - buf = append(buf, socks5Version) - if len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 { - buf = append(buf, 2 /* num auth methods */, socks5AuthNone, socks5AuthPassword) - } else { - buf = append(buf, 1 /* num auth methods */, socks5AuthNone) - } - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write greeting to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read greeting from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - if buf[0] != 5 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " has unexpected version " + strconv.Itoa(int(buf[0]))) - } - if buf[1] == 0xff { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " requires authentication") - } - - // See RFC 1929 - if buf[1] == socks5AuthPassword { - buf = buf[:0] - buf = append(buf, 1 /* password protocol version */) - buf = append(buf, uint8(len(s.user))) - buf = append(buf, s.user...) - buf = append(buf, uint8(len(s.password))) - buf = append(buf, s.password...) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write authentication request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read authentication reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if buf[1] != 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " rejected username/password") +// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given +// address with an optional username and password. +// See RFC 1928 and RFC 1929. +func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error) { + d := socks.NewDialer(network, address) + if forward != nil { + d.ProxyDial = func(_ context.Context, network string, address string) (net.Conn, error) { + return forward.Dial(network, address) } } - - buf = buf[:0] - buf = append(buf, socks5Version, socks5Connect, 0 /* reserved */) - - if ip := net.ParseIP(host); ip != nil { - if ip4 := ip.To4(); ip4 != nil { - buf = append(buf, socks5IP4) - ip = ip4 - } else { - buf = append(buf, socks5IP6) - } - buf = append(buf, ip...) - } else { - if len(host) > 255 { - return errors.New("proxy: destination host name too long: " + host) + if auth != nil { + up := socks.UsernamePassword{ + Username: auth.User, + Password: auth.Password, } - buf = append(buf, socks5Domain) - buf = append(buf, byte(len(host))) - buf = append(buf, host...) - } - buf = append(buf, byte(port>>8), byte(port)) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write connect request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:4]); err != nil { - return errors.New("proxy: failed to read connect reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - failure := "unknown error" - if int(buf[1]) < len(socks5Errors) { - failure = socks5Errors[buf[1]] - } - - if len(failure) > 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " failed to connect: " + failure) - } - - bytesToDiscard := 0 - switch buf[3] { - case socks5IP4: - bytesToDiscard = net.IPv4len - case socks5IP6: - bytesToDiscard = net.IPv6len - case socks5Domain: - _, err := io.ReadFull(conn, buf[:1]) - if err != nil { - return errors.New("proxy: failed to read domain length from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + d.AuthMethods = []socks.AuthMethod{ + socks.AuthMethodNotRequired, + socks.AuthMethodUsernamePassword, } - bytesToDiscard = int(buf[0]) - default: - return errors.New("proxy: got unknown address type " + strconv.Itoa(int(buf[3])) + " from SOCKS5 proxy at " + s.addr) - } - - if cap(buf) < bytesToDiscard { - buf = make([]byte, bytesToDiscard) - } else { - buf = buf[:bytesToDiscard] - } - if _, err := io.ReadFull(conn, buf); err != nil { - return errors.New("proxy: failed to read address from SOCKS5 proxy at " + s.addr + ": " + err.Error()) + d.Authenticate = up.Authenticate } - - // Also need to discard the port number - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read port from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - return nil + return d, nil } diff --git a/cmd/vendor/golang.org/x/net/route/syscall.go b/cmd/vendor/golang.org/x/net/route/syscall.go index c211188b10..5f69ea63d9 100644 --- a/cmd/vendor/golang.org/x/net/route/syscall.go +++ b/cmd/vendor/golang.org/x/net/route/syscall.go @@ -20,7 +20,7 @@ func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { p = unsafe.Pointer(&zero) } - _, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), newlen) if errno != 0 { return error(errno) } diff --git a/cmd/vendor/golang.org/x/net/trace/trace.go b/cmd/vendor/golang.org/x/net/trace/trace.go index bb72a527e8..a46ee0eaa3 100644 --- a/cmd/vendor/golang.org/x/net/trace/trace.go +++ b/cmd/vendor/golang.org/x/net/trace/trace.go @@ -368,7 +368,11 @@ func New(family, title string) Trace { } func (tr *trace) Finish() { - tr.Elapsed = time.Now().Sub(tr.Start) + 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) @@ -381,14 +385,17 @@ func (tr *trace) Finish() { 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(tr.Elapsed.Nanoseconds() / 1e3) + h.addMeasurement(elapsed.Nanoseconds() / 1e3) f.LatencyMu.Lock() f.Latency.Add(h) f.LatencyMu.Unlock() @@ -684,25 +691,20 @@ type trace struct { // Title is the title of this trace. Title string - // Timing information. - Start time.Time - Elapsed time.Duration // zero while active - - // Trace information if non-zero. - traceID uint64 - spanID uint64 - - // Whether this trace resulted in an error. - IsError bool + // Start time of the this trace. + Start time.Time - // Append-only sequence of events (modulo discards). mu sync.RWMutex - events []event + 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 - recycler func(interface{}) - disc discarded // scratch space to avoid allocation + 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 @@ -714,14 +716,18 @@ func (tr *trace) reset() { 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.refs = 0 tr.recycler = nil + tr.mu.Unlock() + + tr.refs = 0 tr.disc = 0 tr.finishStack = nil for i := range tr.eventsBuf { @@ -801,21 +807,31 @@ func (tr *trace) LazyPrintf(format string, a ...interface{}) { tr.addEvent(&lazySprintf{format, a}, false, false) } -func (tr *trace) SetError() { tr.IsError = true } +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() { @@ -824,6 +840,7 @@ func (tr *trace) ref() { 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) { @@ -834,6 +851,7 @@ func (tr *trace) unref() { } }(tr.recycler, tr.events) } + tr.mu.RUnlock() freeTrace(tr) } @@ -844,7 +862,10 @@ func (tr *trace) When() string { } func (tr *trace) ElapsedTime() string { + tr.mu.RLock() t := tr.Elapsed + tr.mu.RUnlock() + if t == 0 { // Active trace. t = time.Since(tr.Start) diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/common.go b/cmd/vendor/golang.org/x/text/cmd/gotext/common.go index 51322db65c..1036592fbf 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/common.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/common.go @@ -21,9 +21,6 @@ const ( // NOTE: The command line tool already prefixes with "gotext:". var ( wrap = func(err error, msg string) error { - if err == nil { - return nil - } return fmt.Errorf("%s: %v", msg, err) } errorf = fmt.Errorf diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go index bc6130a69b..4c2303fd09 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go @@ -37,48 +37,40 @@ func init() { } var messageKeyToIndex = map[string]int{ - "%.2[1]f miles traveled (%[1]f)": 8, - "%[1]s is visiting %[3]s!\n": 3, - "%d files remaining!": 5, - "%d more files remaining!": 4, - "%s is out of order!": 7, - "%s is visiting %s!\n": 2, - "Hello %s!\n": 1, - "Hello world!\n": 0, - "Use the following code for your discount: %d\n": 6, + "%.2[1]f miles traveled (%[1]f)": 6, + "%[1]s is visiting %[3]s!\n": 3, + "%d more files remaining!": 4, + "%s is out of order!": 5, + "%s is visiting %s!\n": 2, + "Hello %s!\n": 1, + "Hello world!\n": 0, } -var deIndex = []uint32{ // 10 elements - 0x00000000, 0x00000011, 0x00000023, 0x0000003d, - 0x00000057, 0x00000076, 0x00000076, 0x00000076, - 0x00000076, 0x00000076, -} // Size: 64 bytes +var deIndex = []uint32{ // 8 elements + 0x00000000, 0x0000000d, 0x0000001b, 0x00000031, + 0x00000047, 0x00000066, 0x00000066, 0x00000066, +} // Size: 56 bytes -const deData string = "" + // Size: 118 bytes - "\x04\x00\x01\x0a\x0c\x02Hallo Welt!\x04\x00\x01\x0a\x0d\x02Hallo %[1]s!" + - "\x04\x00\x01\x0a\x15\x02%[1]s besucht %[2]s!\x04\x00\x01\x0a\x15\x02%[1]" + - "s besucht %[3]s!\x02Noch %[1]d Bestände zu gehen!" +const deData string = "" + // Size: 102 bytes + "\x02Hallo Welt!\x0a\x02Hallo %[1]s!\x0a\x02%[1]s besucht %[2]s!\x0a\x02%" + + "[1]s besucht %[3]s!\x0a\x02Noch %[1]d Bestände zu gehen!" -var en_USIndex = []uint32{ // 10 elements - 0x00000000, 0x00000012, 0x00000024, 0x00000042, - 0x00000060, 0x000000a3, 0x000000ba, 0x000000ef, - 0x00000106, 0x00000125, -} // Size: 64 bytes +var en_USIndex = []uint32{ // 8 elements + 0x00000000, 0x0000000e, 0x0000001c, 0x00000036, + 0x00000050, 0x00000093, 0x000000aa, 0x000000c9, +} // Size: 56 bytes -const en_USData string = "" + // Size: 293 bytes - "\x04\x00\x01\x0a\x0d\x02Hello world!\x04\x00\x01\x0a\x0d\x02Hello %[1]sn" + - "\x04\x00\x01\x0a\x19\x02%[1]s is visiting %[2]s!\x04\x00\x01\x0a\x19\x02" + - "%[1]s is visiting %[3]s!\x14\x01\x81\x01\x00\x02\x14\x02One file remaini" + - "ng!\x00&\x02There are %[1]d more files remaining!\x02%[1]d files remaini" + - "ng!\x04\x00\x01\x0a0\x02Use the following code for your discount: %[1]d" + - "\x02%[1]s is out of order!\x02%.2[1]f miles traveled (%[1]f)" +const en_USData string = "" + // Size: 201 bytes + "\x02Hello world!\x0a\x02Hello %[1]s!\x0a\x02%[1]s is visiting %[2]s!\x0a" + + "\x02%[1]s is visiting %[3]s!\x0a\x04\x01\x81\x01\x00\x02\x14\x02One file" + + " remaining!\x00&\x02There are %[1]d more files remaining!\x02%[1]s is ou" + + "t of order!\x02%.2[1]f miles traveled (%[1]f)" -var zhIndex = []uint32{ // 10 elements +var zhIndex = []uint32{ // 8 elements 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, -} // Size: 64 bytes +} // Size: 56 bytes const zhData string = "" -// Total table size 603 bytes (0KiB); checksum: 1D2754EE +// Total table size 471 bytes (0KiB); checksum: 7746955 diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/main.go b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/main.go index 414b4531aa..cbbc3704bc 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/main.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract/main.go @@ -4,7 +4,8 @@ package main -//go:generate gotext update -out catalog.go +//go:generate gotext extract --lang=de,zh +//go:generate gotext generate -out catalog.go import ( "golang.org/x/text/language" diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/catalog_gen.go b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/catalog_gen.go deleted file mode 100644 index 2c410dcdbb..0000000000 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/catalog_gen.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package main - -import ( - "golang.org/x/text/language" - "golang.org/x/text/message" - "golang.org/x/text/message/catalog" -) - -type dictionary struct { - index []uint32 - data string -} - -func (d *dictionary) Lookup(key string) (data string, ok bool) { - p := messageKeyToIndex[key] - start, end := d.index[p], d.index[p+1] - if start == end { - return "", false - } - return d.data[start:end], true -} - -func init() { - dict := map[string]catalog.Dictionary{ - "en": &dictionary{index: enIndex, data: enData}, - "zh": &dictionary{index: zhIndex, data: zhData}, - } - fallback := language.MustParse("en") - cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) - if err != nil { - panic(err) - } - message.DefaultCatalog = cat -} - -var messageKeyToIndex = map[string]int{ - "Do you like your browser (%s)?\n": 1, - "Hello %s!\n": 0, -} - -var enIndex = []uint32{ // 3 elements - 0x00000000, 0x00000012, 0x00000039, -} // Size: 36 bytes - -const enData string = "" + // Size: 57 bytes - "\x04\x00\x01\x0a\x0d\x02Hello %[1]s!\x04\x00\x01\x0a\x22\x02Do you like " + - "your browser (%[1]s)?" - -var zhIndex = []uint32{ // 3 elements - 0x00000000, 0x00000000, 0x00000000, -} // Size: 36 bytes - -const zhData string = "" - -// Total table size 129 bytes (0KiB); checksum: 9C146C82 diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go index b5eb3b3343..c1ac4494b6 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go @@ -4,7 +4,7 @@ package main -//go:generate gotext -srclang=en update -out=catalog_gen.go -lang=en,zh +//go:generate gotext extract --lang=de,zh import ( "net/http" diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/extract.go b/cmd/vendor/golang.org/x/text/cmd/gotext/extract.go index 103d7e6007..f1f700ba02 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/extract.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/extract.go @@ -5,6 +5,13 @@ package main import ( + "encoding/json" + "io/ioutil" + "os" + "path/filepath" + + "golang.org/x/text/internal" + "golang.org/x/text/language" "golang.org/x/text/message/pipeline" ) @@ -14,7 +21,13 @@ import ( // - handle features (gender, plural) // - message rewriting +var ( + srcLang *string + lang *string +) + func init() { + srcLang = cmdExtract.Flag.String("srclang", "en-US", "the source-code language") lang = cmdExtract.Flag.String("lang", "en-US", "comma-separated list of languages to process") } @@ -24,17 +37,45 @@ var cmdExtract = &Command{ Short: "extracts strings to be translated from code", } -func runExtract(cmd *Command, config *pipeline.Config, args []string) error { - config.Packages = args - state, err := pipeline.Extract(config) +func runExtract(cmd *Command, args []string) error { + tag, err := language.Parse(*srcLang) + if err != nil { + return wrap(err, "") + } + config := &pipeline.Config{ + SourceLanguage: tag, + Packages: args, + } + out, err := pipeline.Extract(config) + + data, err := json.MarshalIndent(out, "", " ") if err != nil { - return wrap(err, "extract failed") + return wrap(err, "") } - if err := state.Import(); err != nil { - return wrap(err, "import failed") + os.MkdirAll(*dir, 0755) + // TODO: this file can probably go if we replace the extract + generate + // cycle with a init once and update cycle. + file := filepath.Join(*dir, extractFile) + if err := ioutil.WriteFile(file, data, 0644); err != nil { + return wrap(err, "could not create file") } - if err := state.Merge(); err != nil { - return wrap(err, "merge failed") + + langs := append(getLangs(), tag) + langs = internal.UniqueTags(langs) + for _, tag := range langs { + // TODO: inject translations from existing files to avoid retranslation. + out.Language = tag + data, err := json.MarshalIndent(out, "", " ") + if err != nil { + return wrap(err, "JSON marshal failed") + } + file := filepath.Join(*dir, tag.String(), outFile) + if err := os.MkdirAll(filepath.Dir(file), 0750); err != nil { + return wrap(err, "dir create failed") + } + if err := ioutil.WriteFile(file, data, 0740); err != nil { + return wrap(err, "write failed") + } } - return wrap(state.Export(), "export failed") + return nil } diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/generate.go b/cmd/vendor/golang.org/x/text/cmd/gotext/generate.go index 36820df8a6..2d3446502d 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/generate.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/generate.go @@ -5,27 +5,100 @@ package main import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "regexp" + "strings" + "golang.org/x/text/message/pipeline" + "golang.org/x/tools/go/loader" ) func init() { out = cmdGenerate.Flag.String("out", "", "output file to write to") } +var ( + out *string +) + var cmdGenerate = &Command{ Run: runGenerate, UsageLine: "generate ", Short: "generates code to insert translated messages", } -func runGenerate(cmd *Command, config *pipeline.Config, args []string) error { - config.Packages = args - s, err := pipeline.Extract(config) +var transRe = regexp.MustCompile(`messages\.(.*)\.json`) + +func runGenerate(cmd *Command, args []string) error { + + prog, err := loadPackages(&loader.Config{}, args) + if err != nil { + return wrap(err, "could not load package") + } + + pkgs := prog.InitialPackages() + if len(pkgs) != 1 { + return fmt.Errorf("more than one package selected: %v", pkgs) + } + pkg := pkgs[0].Pkg.Name() + + // TODO: add in external input. Right now we assume that all files are + // manually created and stored in the textdata directory. + + // Build up index of translations and original messages. + extracted := pipeline.Locale{} + translations := []*pipeline.Locale{} + + err = filepath.Walk(*dir, func(path string, f os.FileInfo, err error) error { + if err != nil { + return wrap(err, "loading data") + } + if f.IsDir() { + return nil + } + if f.Name() == extractFile { + b, err := ioutil.ReadFile(path) + if err != nil { + return wrap(err, "read file failed") + } + if err := json.Unmarshal(b, &extracted); err != nil { + return wrap(err, "unmarshal source failed") + } + return nil + } + if f.Name() == outFile { + return nil + } + if !strings.HasSuffix(path, gotextSuffix) { + return nil + } + b, err := ioutil.ReadFile(path) + if err != nil { + return wrap(err, "read file failed") + } + var locale pipeline.Locale + if err := json.Unmarshal(b, &locale); err != nil { + return wrap(err, "parsing translation file failed") + } + translations = append(translations, &locale) + return nil + }) if err != nil { - return wrap(err, "extraction failed") + return err } - if err := s.Import(); err != nil { - return wrap(err, "import failed") + + w := os.Stdout + if *out != "" { + w, err = os.Create(*out) + if err != nil { + return wrap(err, "create file failed") + } } - return wrap(s.Generate(), "generation failed") + + _, err = pipeline.Generate(w, pkg, &extracted, translations...) + return err } diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/main.go b/cmd/vendor/golang.org/x/text/cmd/gotext/main.go index 73f6d91cb1..f3f50d7970 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/main.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/main.go @@ -25,8 +25,6 @@ import ( "unicode" "unicode/utf8" - "golang.org/x/text/message/pipeline" - "golang.org/x/text/language" "golang.org/x/tools/go/buildutil" ) @@ -35,23 +33,7 @@ func init() { flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", buildutil.TagsFlagDoc) } -var ( - srcLang = flag.String("srclang", "en-US", "the source-code language") - dir = flag.String("dir", "locales", "default subdirectory to store translation files") -) - -func config() (*pipeline.Config, error) { - tag, err := language.Parse(*srcLang) - if err != nil { - return nil, wrap(err, "invalid srclang") - } - return &pipeline.Config{ - SourceLanguage: tag, - Supported: getLangs(), - TranslationsPattern: `messages\.(.*)\.json`, - GenFile: *out, - }, nil -} +var dir = flag.String("dir", "locales", "default subdirectory to store translation files") // NOTE: the Command struct is copied from the go tool in core. @@ -60,7 +42,7 @@ func config() (*pipeline.Config, error) { type Command struct { // Run runs the command. // The args are the arguments after the command name. - Run func(cmd *Command, c *pipeline.Config, args []string) error + Run func(cmd *Command, args []string) error // UsageLine is the one-line usage message. // The first word in the line is taken to be the command name. @@ -101,7 +83,6 @@ func (c *Command) Runnable() bool { // Commands lists the available commands and help topics. // The order here is the order in which they are printed by 'go help'. var commands = []*Command{ - cmdUpdate, cmdExtract, cmdRewrite, cmdGenerate, @@ -143,11 +124,7 @@ func main() { cmd.Flag.Usage = func() { cmd.Usage() } cmd.Flag.Parse(args[1:]) args = cmd.Flag.Args() - config, err := config() - if err != nil { - fatalf("gotext: %+v", err) - } - if err := cmd.Run(cmd, config, args); err != nil { + if err := cmd.Run(cmd, args); err != nil { fatalf("gotext: %+v", err) } exit() diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/rewrite.go b/cmd/vendor/golang.org/x/text/cmd/gotext/rewrite.go index 3ee9555e37..a35b727df5 100644 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/rewrite.go +++ b/cmd/vendor/golang.org/x/text/cmd/gotext/rewrite.go @@ -38,7 +38,7 @@ using Printf to allow translators to reorder arguments. `, } -func runRewrite(cmd *Command, _ *pipeline.Config, args []string) error { +func runRewrite(cmd *Command, args []string) error { w := os.Stdout if *overwrite { w = nil diff --git a/cmd/vendor/golang.org/x/text/cmd/gotext/update.go b/cmd/vendor/golang.org/x/text/cmd/gotext/update.go deleted file mode 100644 index 1260750cc3..0000000000 --- a/cmd/vendor/golang.org/x/text/cmd/gotext/update.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "golang.org/x/text/message/pipeline" -) - -// TODO: -// - merge information into existing files -// - handle different file formats (PO, XLIFF) -// - handle features (gender, plural) -// - message rewriting - -var ( - lang *string - out *string -) - -func init() { - lang = cmdUpdate.Flag.String("lang", "en-US", "comma-separated list of languages to process") - out = cmdUpdate.Flag.String("out", "", "output file to write to") -} - -var cmdUpdate = &Command{ - Run: runUpdate, - UsageLine: "update * [-out ]", - Short: "merge translations and generate catalog", -} - -func runUpdate(cmd *Command, config *pipeline.Config, args []string) error { - config.Packages = args - state, err := pipeline.Extract(config) - if err != nil { - return wrap(err, "extract failed") - } - if err := state.Import(); err != nil { - return wrap(err, "import failed") - } - if err := state.Merge(); err != nil { - return wrap(err, "merge failed") - } - if err := state.Export(); err != nil { - return wrap(err, "export failed") - } - if *out != "" { - return wrap(state.Generate(), "generation failed") - } - return nil -} diff --git a/cmd/vendor/golang.org/x/text/doc.go b/cmd/vendor/golang.org/x/text/doc.go index 2e19a419c7..a48e2843fc 100644 --- a/cmd/vendor/golang.org/x/text/doc.go +++ b/cmd/vendor/golang.org/x/text/doc.go @@ -7,9 +7,6 @@ // text is a repository of text-related packages related to internationalization // (i18n) and localization (l10n), such as character encodings, text // transformations, and locale-specific text handling. -// -// There is a 30 minute video, recorded on 2017-11-30, on the "State of -// golang.org/x/text" at https://www.youtube.com/watch?v=uYrDrMEGu58 package text // TODO: more documentation on general concepts, such as Transformers, use diff --git a/cmd/vendor/golang.org/x/text/internal/catmsg/catmsg.go b/cmd/vendor/golang.org/x/text/internal/catmsg/catmsg.go index c0bf86f092..32d6c20516 100644 --- a/cmd/vendor/golang.org/x/text/internal/catmsg/catmsg.go +++ b/cmd/vendor/golang.org/x/text/internal/catmsg/catmsg.go @@ -104,24 +104,20 @@ const ( msgFirst msgRaw msgString - msgAffix - // Leave some arbitrary room for future expansion: 20 should suffice. - numInternal = 20 + numFixed ) const prefix = "golang.org/x/text/internal/catmsg." var ( - // TODO: find a more stable way to link handles to message types. mutex sync.Mutex names = map[string]Handle{ prefix + "Vars": msgVars, prefix + "First": msgFirst, prefix + "Raw": msgRaw, prefix + "String": msgString, - prefix + "Affix": msgAffix, } - handlers = make([]Handler, numInternal) + handlers = make([]Handler, numFixed) ) func init() { @@ -165,20 +161,6 @@ func init() { } return true } - - handlers[msgAffix] = func(d *Decoder) bool { - // TODO: use an alternative method for common cases. - prefix := d.DecodeString() - suffix := d.DecodeString() - if prefix != "" { - d.Render(prefix) - } - ret := d.ExecuteMessage() - if suffix != "" { - d.Render(suffix) - } - return ret - } } var ( @@ -392,24 +374,3 @@ func (s String) Compile(e *Encoder) (err error) { } return err } - -// Affix is a message that adds a prefix and suffix to another message. -// This is mostly used add back whitespace to a translation that was stripped -// before sending it out. -type Affix struct { - Message Message - Prefix string - Suffix string -} - -// Compile implements Message. -func (a Affix) Compile(e *Encoder) (err error) { - // TODO: consider adding a special message type that just adds a single - // return. This is probably common enough to handle the majority of cases. - // Get some stats first, though. - e.EncodeMessageType(msgAffix) - e.EncodeString(a.Prefix) - e.EncodeString(a.Suffix) - e.EncodeMessage(a.Message) - return nil -} diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/extract.go b/cmd/vendor/golang.org/x/text/message/pipeline/extract.go index 379cc6d86b..20ad91463c 100644 --- a/cmd/vendor/golang.org/x/text/message/pipeline/extract.go +++ b/cmd/vendor/golang.org/x/text/message/pipeline/extract.go @@ -28,12 +28,8 @@ import ( // - handle features (gender, plural) // - message rewriting -// - %m substitutions -// - `msg:"etc"` tags -// - msg/Msg top-level vars and strings. - // Extract extracts all strings form the package defined in Config. -func Extract(c *Config) (*State, error) { +func Extract(c *Config) (*Locale, error) { conf := loader.Config{} prog, err := loadPackages(&conf, c.Packages) if err != nil { @@ -145,11 +141,9 @@ func Extract(c *Config) (*State, error) { ph := placeholders{index: map[string]string{}} - trimmed, _, _ := trimWS(fmtMsg) - p := fmtparser.Parser{} p.Reset(simArgs) - for p.SetFormat(trimmed); p.Scan(); { + for p.SetFormat(fmtMsg); p.Scan(); { switch p.Status { case fmtparser.StatusText: msg += p.Text() @@ -195,14 +189,11 @@ func Extract(c *Config) (*State, error) { } } - return &State{ - Config: *c, - program: prog, - Extracted: Messages{ - Language: c.SourceLanguage, - Messages: messages, - }, - }, nil + out := &Locale{ + Language: c.SourceLanguage, + Messages: messages, + } + return out, nil } func posString(conf loader.Config, info *loader.PackageInfo, pos token.Pos) string { @@ -251,7 +242,7 @@ func strip(s string) string { if unicode.IsSpace(r) || r == '-' { return '_' } - if !unicode.In(r, unicode.Letter, unicode.Mark, unicode.Number) { + if !unicode.In(r, unicode.Letter, unicode.Mark) { return -1 } return r diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/generate.go b/cmd/vendor/golang.org/x/text/message/pipeline/generate.go index 5d329b2f43..c5e51bd8f3 100644 --- a/cmd/vendor/golang.org/x/text/message/pipeline/generate.go +++ b/cmd/vendor/golang.org/x/text/message/pipeline/generate.go @@ -6,9 +6,7 @@ package pipeline import ( "fmt" - "go/build" "io" - "path/filepath" "regexp" "sort" "strings" @@ -20,75 +18,23 @@ import ( "golang.org/x/text/internal/catmsg" "golang.org/x/text/internal/gen" "golang.org/x/text/language" - "golang.org/x/tools/go/loader" ) var transRe = regexp.MustCompile(`messages\.(.*)\.json`) -// Generate writes a Go file that defines a Catalog with translated messages. -// Translations are retrieved from s.Messages, not s.Translations, so it -// is assumed Merge has been called. -func (s *State) Generate() error { - path := s.Config.GenPackage - if path == "" { - path = "." - } - isDir := path[0] == '.' - prog, err := loadPackages(&loader.Config{}, []string{path}) - if err != nil { - return wrap(err, "could not load package") - } - pkgs := prog.InitialPackages() - if len(pkgs) != 1 { - return errorf("more than one package selected: %v", pkgs) - } - pkg := pkgs[0].Pkg.Name() - - cw, err := s.generate() - if err != nil { - return err - } - if !isDir { - gopath := build.Default.GOPATH - path = filepath.Join(gopath, filepath.FromSlash(pkgs[0].Pkg.Path())) - } - path = filepath.Join(path, s.Config.GenFile) - cw.WriteGoFile(path, pkg) // TODO: WriteGoFile should return error. - return err -} +// Generate writes a Go file with the given package name to w, which defines a +// Catalog with translated messages. +func Generate(w io.Writer, pkg string, extracted *Locale, trans ...*Locale) (n int, err error) { + // TODO: add in external input. Right now we assume that all files are + // manually created and stored in the textdata directory. -// WriteGen writes a Go file with the given package name to w that defines a -// Catalog with translated messages. Translations are retrieved from s.Messages, -// not s.Translations, so it is assumed Merge has been called. -func (s *State) WriteGen(w io.Writer, pkg string) error { - cw, err := s.generate() - if err != nil { - return err - } - _, err = cw.WriteGo(w, pkg, "") - return err -} - -// Generate is deprecated; use (*State).Generate(). -func Generate(w io.Writer, pkg string, extracted *Messages, trans ...Messages) (n int, err error) { - s := State{ - Extracted: *extracted, - Translations: trans, - } - cw, err := s.generate() - if err != nil { - return 0, err - } - return cw.WriteGo(w, pkg, "") -} - -func (s *State) generate() (*gen.CodeWriter, error) { // Build up index of translations and original messages. translations := map[language.Tag]map[string]Message{} languages := []language.Tag{} + langVars := []string{} usedKeys := map[string]int{} - for _, loc := range s.Messages { + for _, loc := range trans { tag := loc.Language if _, ok := translations[tag]; !ok { translations[tag] = map[string]Message{} @@ -98,7 +44,7 @@ func (s *State) generate() (*gen.CodeWriter, error) { if !m.Translation.IsEmpty() { for _, id := range m.ID { if _, ok := translations[tag][id]; ok { - warnf("Duplicate translation in locale %q for message %q", tag, id) + logf("Duplicate translation in locale %q for message %q", tag, id) } translations[tag][id] = m } @@ -109,11 +55,10 @@ func (s *State) generate() (*gen.CodeWriter, error) { // Verify completeness and register keys. internal.SortTags(languages) - langVars := []string{} for _, tag := range languages { langVars = append(langVars, strings.Replace(tag.String(), "-", "_", -1)) dict := translations[tag] - for _, msg := range s.Extracted.Messages { + for _, msg := range extracted.Messages { for _, id := range msg.ID { if trans, ok := dict[id]; ok && !trans.Translation.IsEmpty() { if _, ok := usedKeys[msg.Key]; !ok { @@ -122,7 +67,7 @@ func (s *State) generate() (*gen.CodeWriter, error) { break } // TODO: log missing entry. - warnf("%s: Missing entry for %q.", tag, id) + logf("%s: Missing entry for %q.", tag, id) } } } @@ -133,12 +78,12 @@ func (s *State) generate() (*gen.CodeWriter, error) { Fallback language.Tag Languages []string }{ - Fallback: s.Extracted.Language, + Fallback: extracted.Language, Languages: langVars, } if err := lookup.Execute(cw, x); err != nil { - return nil, wrap(err, "error") + return 0, wrap(err, "error") } keyToIndex := []string{} @@ -155,29 +100,21 @@ func (s *State) generate() (*gen.CodeWriter, error) { for i, tag := range languages { dict := translations[tag] a := make([]string, len(usedKeys)) - for _, msg := range s.Extracted.Messages { + for _, msg := range extracted.Messages { for _, id := range msg.ID { if trans, ok := dict[id]; ok && !trans.Translation.IsEmpty() { m, err := assemble(&msg, &trans.Translation) if err != nil { - return nil, wrap(err, "error") - } - _, leadWS, trailWS := trimWS(msg.Key) - if leadWS != "" || trailWS != "" { - m = catmsg.Affix{ - Message: m, - Prefix: leadWS, - Suffix: trailWS, - } + return 0, wrap(err, "error") } // TODO: support macros. data, err := catmsg.Compile(tag, nil, m) if err != nil { - return nil, wrap(err, "error") + return 0, wrap(err, "error") } key := usedKeys[msg.Key] if d := a[key]; d != "" && d != data { - warnf("Duplicate non-consistent translation for key %q, picking the one for message %q", msg.Key, id) + logf("Duplicate non-consistent translation for key %q, picking the one for message %q", msg.Key, id) } a[key] = string(data) break @@ -194,7 +131,7 @@ func (s *State) generate() (*gen.CodeWriter, error) { cw.WriteVar(langVars[i]+"Index", index) cw.WriteConst(langVars[i]+"Data", strings.Join(a, "")) } - return cw, nil + return cw.WriteGo(w, pkg, "") } func assemble(m *Message, t *Text) (msg catmsg.Message, err error) { diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/message.go b/cmd/vendor/golang.org/x/text/message/pipeline/message.go index c83a8fd878..8e54700719 100644 --- a/cmd/vendor/golang.org/x/text/message/pipeline/message.go +++ b/cmd/vendor/golang.org/x/text/message/pipeline/message.go @@ -6,7 +6,6 @@ package pipeline import ( "encoding/json" - "errors" "strings" "golang.org/x/text/language" @@ -24,8 +23,28 @@ import ( // the format string "%d file(s) remaining". // See the examples directory for examples of extracted messages. -// Messages is used to store translations for a single language. -type Messages struct { +// Config contains configuration for the translation pipeline. +type Config struct { + SourceLanguage language.Tag + + // Supported indicates the languages for which data should be generated. + // If unspecified, it will attempt to derive the set of supported languages + // from the context. + Supported []language.Tag + + Packages []string + + // TODO: + // - Printf-style configuration + // - Template-style configuration + // - Extraction options + // - Rewrite options + // - Generation options +} + +// A Locale is used to store all information for a single locale. This type is +// used both for extraction and injection. +type Locale struct { Language language.Tag `json:"language"` Messages []Message `json:"messages"` Macros map[string]Text `json:"macros,omitempty"` @@ -36,7 +55,7 @@ type Message struct { // ID contains a list of identifiers for the message. ID IDList `json:"id"` // Key is the string that is used to look up the message at runtime. - Key string `json:"key,omitempty"` + Key string `json:"key"` Meaning string `json:"meaning,omitempty"` Message Text `json:"message"` Translation Text `json:"translation"` @@ -46,11 +65,6 @@ type Message struct { Placeholders []Placeholder `json:"placeholders,omitempty"` - // Fuzzy indicates that the provide translation needs review by a - // translator, for instance because it was derived from automated - // translation. - Fuzzy bool `json:"fuzzy,omitempty"` - // TODO: default placeholder syntax is {foo}. Allow alternative escaping // like `foo`. @@ -100,20 +114,6 @@ func (m *Message) Substitute(msg string) (sub string, err error) { return sub, err } -var errIncompatibleMessage = errors.New("messages incompatible") - -func checkEquivalence(a, b *Message) error { - for _, v := range a.ID { - for _, w := range b.ID { - if v == w { - return nil - } - } - } - // TODO: canonicalize placeholders and check for type equivalence. - return errIncompatibleMessage -} - // A Placeholder is a part of the message that should not be changed by a // translator. It can be used to hide or prettify format strings (e.g. %d or // {{.Count}}), hide HTML, or mark common names that should not be translated. diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/pipeline.go b/cmd/vendor/golang.org/x/text/message/pipeline/pipeline.go index cafd6f29b7..733a50c57f 100644 --- a/cmd/vendor/golang.org/x/text/message/pipeline/pipeline.go +++ b/cmd/vendor/golang.org/x/text/message/pipeline/pipeline.go @@ -8,398 +8,33 @@ package pipeline import ( - "bytes" - "encoding/json" "fmt" "go/build" "go/parser" - "io/ioutil" "log" - "os" - "path/filepath" - "regexp" - "strings" - "text/template" - "unicode" - "golang.org/x/text/internal" - "golang.org/x/text/language" - "golang.org/x/text/runes" "golang.org/x/tools/go/loader" ) const ( extractFile = "extracted.gotext.json" outFile = "out.gotext.json" - gotextSuffix = "gotext.json" + gotextSuffix = ".gotext.json" ) -// Config contains configuration for the translation pipeline. -type Config struct { - // Supported indicates the languages for which data should be generated. - // The default is to support all locales for which there are matching - // translation files. - Supported []language.Tag - - // --- Extraction - - SourceLanguage language.Tag - - Packages []string - - // --- File structure - - // Dir is the root dir for all operations. - Dir string - - // TranslationsPattern is a regular expression to match incoming translation - // files. These files may appear in any directory rooted at Dir. - // language for the translation files is determined as follows: - // 1. From the Language field in the file. - // 2. If not present, from a valid language tag in the filename, separated - // by dots (e.g. "en-US.json" or "incoming.pt_PT.xmb"). - // 3. If not present, from a the closest subdirectory in which the file - // is contained that parses as a valid language tag. - TranslationsPattern string - - // OutPattern defines the location for translation files for a certain - // language. The default is "{{.Dir}}/{{.Language}}/out.{{.Ext}}" - OutPattern string - - // Format defines the file format for generated translation files. - // The default is XMB. Alternatives are GetText, XLIFF, L20n, GoText. - Format string - - Ext string - - // TODO: - // Actions are additional actions to be performed after the initial extract - // and merge. - // Actions []struct { - // Name string - // Options map[string]string - // } - - // --- Generation - - // GenFile may be in a different package. It is not defined, it will - // be written to stdout. - GenFile string - - // GenPackage is the package or relative path into which to generate the - // file. If not specified it is relative to the current directory. - GenPackage string - - // DeclareVar defines a variable to which to assing the generated Catalog. - DeclareVar string - - // SetDefault determines whether to assign the generated Catalog to - // message.DefaultCatalog. The default for this is true if DeclareVar is - // not defined, false otherwise. - SetDefault bool - - // TODO: - // - Printf-style configuration - // - Template-style configuration - // - Extraction options - // - Rewrite options - // - Generation options -} - -// Operations: -// - extract: get the strings -// - disambiguate: find messages with the same key, but possible different meaning. -// - create out: create a list of messages that need translations -// - load trans: load the list of current translations -// - merge: assign list of translations as done -// - (action)expand: analyze features and create example sentences for each version. -// - (action)googletrans: pre-populate messages with automatic translations. -// - (action)export: send out messages somewhere non-standard -// - (action)import: load messages from somewhere non-standard -// - vet program: don't pass "foo" + var + "bar" strings. Not using funcs for translated strings. -// - vet trans: coverage: all translations/ all features. -// - generate: generate Go code - -// State holds all accumulated information on translations during processing. -type State struct { - Config Config - - Package string - program *loader.Program - - Extracted Messages `json:"messages"` - - // Messages includes all messages for which there need to be translations. - // Duplicates may be eliminated. Generation will be done from these messages - // (usually after merging). - Messages []Messages - - // Translations are incoming translations for the application messages. - Translations []Messages -} - -func (s *State) dir() string { - if d := s.Config.Dir; d != "" { - return d - } - return "./locales" -} - -func outPattern(s *State) (string, error) { - c := s.Config - pat := c.OutPattern - if pat == "" { - pat = "{{.Dir}}/{{.Language}}/out.{{.Ext}}" - } - - ext := c.Ext - if ext == "" { - ext = c.Format - } - if ext == "" { - ext = gotextSuffix - } - t, err := template.New("").Parse(pat) - if err != nil { - return "", wrap(err, "error parsing template") - } - buf := bytes.Buffer{} - err = t.Execute(&buf, map[string]string{ - "Dir": s.dir(), - "Language": "%s", - "Ext": ext, - }) - return filepath.FromSlash(buf.String()), wrap(err, "incorrect OutPattern") -} - -var transRE = regexp.MustCompile(`.*\.` + gotextSuffix) - -// Import loads existing translation files. -func (s *State) Import() error { - outPattern, err := outPattern(s) - if err != nil { - return err - } - re := transRE - if pat := s.Config.TranslationsPattern; pat != "" { - if re, err = regexp.Compile(pat); err != nil { - return wrapf(err, "error parsing regexp %q", s.Config.TranslationsPattern) - } - } - x := importer{s, outPattern, re} - return x.walkImport(s.dir(), s.Config.SourceLanguage) -} - -type importer struct { - state *State - outPattern string - transFile *regexp.Regexp -} - -func (i *importer) walkImport(path string, tag language.Tag) error { - files, err := ioutil.ReadDir(path) - if err != nil { - return nil - } - for _, f := range files { - name := f.Name() - tag := tag - if f.IsDir() { - if t, err := language.Parse(name); err == nil { - tag = t - } - // We ignore errors - if err := i.walkImport(filepath.Join(path, name), tag); err != nil { - return err - } - continue - } - for _, l := range strings.Split(name, ".") { - if t, err := language.Parse(l); err == nil { - tag = t - } - } - file := filepath.Join(path, name) - // TODO: Should we skip files that match output files? - if fmt.Sprintf(i.outPattern, tag) == file { - continue - } - // TODO: handle different file formats. - if !i.transFile.MatchString(name) { - continue - } - b, err := ioutil.ReadFile(file) - if err != nil { - return wrap(err, "read file failed") - } - var translations Messages - if err := json.Unmarshal(b, &translations); err != nil { - return wrap(err, "parsing translation file failed") - } - i.state.Translations = append(i.state.Translations, translations) - } - return nil -} - -// Merge merges the extracted messages with the existing translations. -func (s *State) Merge() error { - if s.Messages != nil { - panic("already merged") - } - // Create an index for each unique message. - // Duplicates are okay as long as the substitution arguments are okay as - // well. - // Top-level messages are okay to appear in multiple substitution points. - - // Collect key equivalence. - msgs := []*Message{} - keyToIDs := map[string]*Message{} - for _, m := range s.Extracted.Messages { - m := m - if prev, ok := keyToIDs[m.Key]; ok { - if err := checkEquivalence(&m, prev); err != nil { - warnf("Key %q matches conflicting messages: %v and %v", m.Key, prev.ID, m.ID) - // TODO: track enough information so that the rewriter can - // suggest/disambiguate messages. - } - // TODO: add position to message. - continue - } - i := len(msgs) - msgs = append(msgs, &m) - keyToIDs[m.Key] = msgs[i] - } - - // Messages with different keys may still refer to the same translated - // message (e.g. different whitespace). Filter these. - idMap := map[string]bool{} - filtered := []*Message{} - for _, m := range msgs { - found := false - for _, id := range m.ID { - found = found || idMap[id] - } - if !found { - filtered = append(filtered, m) - } - for _, id := range m.ID { - idMap[id] = true - } - } - - // Build index of translations. - translations := map[language.Tag]map[string]Message{} - languages := append([]language.Tag{}, s.Config.Supported...) - - for _, t := range s.Translations { - tag := t.Language - if _, ok := translations[tag]; !ok { - translations[tag] = map[string]Message{} - languages = append(languages, tag) - } - for _, m := range t.Messages { - if !m.Translation.IsEmpty() { - for _, id := range m.ID { - if _, ok := translations[tag][id]; ok { - warnf("Duplicate translation in locale %q for message %q", tag, id) - } - translations[tag][id] = m - } - } - } - } - languages = internal.UniqueTags(languages) - - for _, tag := range languages { - ms := Messages{Language: tag} - for _, orig := range filtered { - m := *orig - m.Key = "" - m.Position = "" - - for _, id := range m.ID { - if t, ok := translations[tag][id]; ok { - m.Translation = t.Translation - if t.TranslatorComment != "" { - m.TranslatorComment = t.TranslatorComment - m.Fuzzy = t.Fuzzy - } - break - } - } - if tag == s.Config.SourceLanguage && m.Translation.IsEmpty() { - m.Translation = m.Message - if m.TranslatorComment == "" { - m.TranslatorComment = "Copied from source." - m.Fuzzy = true - } - } - // TODO: if translation is empty: pre-expand based on available - // linguistic features. This may also be done as a plugin. - ms.Messages = append(ms.Messages, m) - } - s.Messages = append(s.Messages, ms) - } - return nil -} - -// Export writes out the messages to translation out files. -func (s *State) Export() error { - path, err := outPattern(s) - if err != nil { - return wrap(err, "export failed") - } - for _, out := range s.Messages { - // TODO: inject translations from existing files to avoid retranslation. - data, err := json.MarshalIndent(out, "", " ") - if err != nil { - return wrap(err, "JSON marshal failed") - } - file := fmt.Sprintf(path, out.Language) - if err := os.MkdirAll(filepath.Dir(file), 0755); err != nil { - return wrap(err, "dir create failed") - } - if err := ioutil.WriteFile(file, data, 0644); err != nil { - return wrap(err, "write failed") - } - } - return nil -} - -var ( - ws = runes.In(unicode.White_Space).Contains - notWS = runes.NotIn(unicode.White_Space).Contains -) - -func trimWS(s string) (trimmed, leadWS, trailWS string) { - trimmed = strings.TrimRightFunc(s, ws) - trailWS = s[len(trimmed):] - if i := strings.IndexFunc(trimmed, notWS); i > 0 { - leadWS = trimmed[:i] - trimmed = trimmed[i:] - } - return trimmed, leadWS, trailWS -} - // NOTE: The command line tool already prefixes with "gotext:". var ( wrap = func(err error, msg string) error { - if err == nil { - return nil - } return fmt.Errorf("%s: %v", msg, err) } wrapf = func(err error, msg string, args ...interface{}) error { - if err == nil { - return nil - } return wrap(err, fmt.Sprintf(msg, args...)) } errorf = fmt.Errorf ) -func warnf(format string, args ...interface{}) { - // TODO: don't log. +// TODO: don't log. +func logf(format string, args ...interface{}) { log.Printf(format, args...) } diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/rewrite.go b/cmd/vendor/golang.org/x/text/message/pipeline/rewrite.go index cf1511f56c..fa78324e1b 100644 --- a/cmd/vendor/golang.org/x/text/message/pipeline/rewrite.go +++ b/cmd/vendor/golang.org/x/text/message/pipeline/rewrite.go @@ -24,11 +24,11 @@ const printerType = "golang.org/x/text/message.Printer" // machinery and rewrites strings to adopt best practices when possible. // If w is not nil the generated files are written to it, each files with a // "--- " header. Otherwise the files are overwritten. -func Rewrite(w io.Writer, args ...string) error { +func Rewrite(w io.Writer, goPackage string) error { conf := &loader.Config{ AllowErrors: true, // Allow unused instances of message.Printer. } - prog, err := loadPackages(conf, args) + prog, err := loadPackages(conf, []string{goPackage}) if err != nil { return wrap(err, "") } diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go b/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go deleted file mode 100644 index 7d93f4868f..0000000000 --- a/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package main - -import ( - "golang.org/x/text/language" - "golang.org/x/text/message" - "golang.org/x/text/message/catalog" -) - -type dictionary struct { - index []uint32 - data string -} - -func (d *dictionary) Lookup(key string) (data string, ok bool) { - p := messageKeyToIndex[key] - start, end := d.index[p], d.index[p+1] - if start == end { - return "", false - } - return d.data[start:end], true -} - -func init() { - dict := map[string]catalog.Dictionary{ - "de": &dictionary{index: deIndex, data: deData}, - "en_US": &dictionary{index: en_USIndex, data: en_USData}, - "zh": &dictionary{index: zhIndex, data: zhData}, - } - fallback := language.MustParse("en-US") - cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) - if err != nil { - panic(err) - } - message.DefaultCatalog = cat -} - -var messageKeyToIndex = map[string]int{ - "%.2[1]f miles traveled (%[1]f)": 8, - "%[1]s is visiting %[3]s!\n": 3, - "%d files remaining!": 4, - "%d more files remaining!": 5, - "%s is out of order!": 7, - "%s is visiting %s!\n": 2, - "Hello %s!\n": 1, - "Hello world!\n": 0, - "Use the following code for your discount: %d\n": 6, -} - -var deIndex = []uint32{ // 10 elements - 0x00000000, 0x00000011, 0x00000023, 0x0000003d, - 0x00000057, 0x00000075, 0x00000094, 0x00000094, - 0x00000094, 0x00000094, -} // Size: 64 bytes - -const deData string = "" + // Size: 148 bytes - "\x04\x00\x01\x0a\x0c\x02Hallo Welt!\x04\x00\x01\x0a\x0d\x02Hallo %[1]s!" + - "\x04\x00\x01\x0a\x15\x02%[1]s besucht %[2]s!\x04\x00\x01\x0a\x15\x02%[1]" + - "s besucht %[3]s!\x02Noch zwei Bestände zu gehen!\x02Noch %[1]d Bestände " + - "zu gehen!" - -var en_USIndex = []uint32{ // 10 elements - 0x00000000, 0x00000012, 0x00000024, 0x00000042, - 0x00000060, 0x00000077, 0x000000ba, 0x000000ef, - 0x00000106, 0x00000125, -} // Size: 64 bytes - -const en_USData string = "" + // Size: 293 bytes - "\x04\x00\x01\x0a\x0d\x02Hello world!\x04\x00\x01\x0a\x0d\x02Hello %[1]s!" + - "\x04\x00\x01\x0a\x19\x02%[1]s is visiting %[2]s!\x04\x00\x01\x0a\x19\x02" + - "%[1]s is visiting %[3]s!\x02%[1]d files remaining!\x14\x01\x81\x01\x00" + - "\x02\x14\x02One file remaining!\x00&\x02There are %[1]d more files remai" + - "ning!\x04\x00\x01\x0a0\x02Use the following code for your discount: %[1]" + - "d\x02%[1]s is out of order!\x02%.2[1]f miles traveled (%[1]f)" - -var zhIndex = []uint32{ // 10 elements - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, -} // Size: 64 bytes - -const zhData string = "" - -// Total table size 633 bytes (0KiB); checksum: 74B32E70 diff --git a/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/test1.go b/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/test1.go deleted file mode 100644 index 88051f932e..0000000000 --- a/cmd/vendor/golang.org/x/text/message/pipeline/testdata/test1/test1.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import "golang.org/x/text/message" - -func main() { - p := message.NewPrinter(message.MatchLanguage("en")) - - // NOT EXTRACTED: strings passed to Println are not extracted. - p.Println("Hello world!") - - // NOT EXTRACTED: strings passed to Print are not extracted. - p.Print("Hello world!\n") - - // Extract and trim whitespace (TODO). - p.Printf("Hello world!\n") - - // NOT EXTRACTED: city is not used as a pattern or passed to %m. - city := "Amsterdam" - // This comment is extracted. - p.Printf("Hello %s!\n", city) - - person := "Sheila" - place := "Zürich" - - // Substitutions replaced by variable names. - p.Printf("%s is visiting %s!\n", - person, // The person of matter. - place, // Place the person is visiting. - ) - - pp := struct { - Person string // The person of matter. // TODO: get this comment. - Place string - extra int - }{ - person, place, 4, - } - - // extract will drop this comment in favor of the one below. - p.Printf("%[1]s is visiting %[3]s!\n", // Field names are placeholders. - pp.Person, - pp.extra, - pp.Place, // Place the person is visiting. - ) - - // Numeric literal becomes placeholder. - p.Printf("%d files remaining!", 2) - - const n = 2 - - // Constant identifier becomes placeholder. - p.Printf("%d more files remaining!", n) - - // Infer better names from type names. - type referralCode int - - const c = referralCode(5) - - // Use type name as placeholder. - p.Printf("Use the following code for your discount: %d\n", c) - - // Use constant name as message ID. - const msgOutOfOrder = "%s is out of order!" // This comment wins. - const device = "Soda machine" - // This message has two IDs. - p.Printf(msgOutOfOrder, device) - - // Multiple substitutions for same argument. - miles := 1.2345 - p.Printf("%.2[1]f miles traveled (%[1]f)", miles) -} diff --git a/cmd/vendor/golang.org/x/tools/blog/blog.go b/cmd/vendor/golang.org/x/tools/blog/blog.go index 4055b1b7c6..73c184d4b4 100644 --- a/cmd/vendor/golang.org/x/tools/blog/blog.go +++ b/cmd/vendor/golang.org/x/tools/blog/blog.go @@ -24,7 +24,14 @@ import ( "golang.org/x/tools/present" ) -var validJSONPFunc = regexp.MustCompile(`(?i)^[a-z_][a-z0-9_.]*$`) +var ( + validJSONPFunc = regexp.MustCompile(`(?i)^[a-z_][a-z0-9_.]*$`) + // used to serve relative paths when ServeLocalLinks is enabled. + golangOrgAbsLinkReplacer = strings.NewReplacer( + `href="https://golang.org/pkg`, `href="/pkg`, + `href="https://golang.org/cmd`, `href="/cmd`, + ) +) // Config specifies Server configuration values. type Config struct { @@ -40,7 +47,8 @@ type Config struct { FeedArticles int // Articles to include in Atom and JSON feeds. FeedTitle string // The title of the Atom XML feed - PlayEnabled bool + PlayEnabled bool + ServeLocalLinks bool // rewrite golang.org/{pkg,cmd} links to host-less, relative paths. } // Doc represents an article adorned with presentation data. @@ -191,8 +199,8 @@ func (s *Server) loadDocs(root string) error { if err != nil { return err } - html := new(bytes.Buffer) - err = d.Render(html, s.template.doc) + var html bytes.Buffer + err = d.Render(&html, s.template.doc) if err != nil { return err } @@ -417,7 +425,18 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { d.Doc = doc t = s.template.article } - err := t.ExecuteTemplate(w, "root", d) + var err error + if s.cfg.ServeLocalLinks { + var buf bytes.Buffer + err = t.ExecuteTemplate(&buf, "root", d) + if err != nil { + log.Println(err) + return + } + _, err = golangOrgAbsLinkReplacer.WriteString(w, buf.String()) + } else { + err = t.ExecuteTemplate(w, "root", d) + } if err != nil { log.Println(err) } diff --git a/cmd/vendor/golang.org/x/tools/cmd/godoc/autocert.go b/cmd/vendor/golang.org/x/tools/cmd/godoc/autocert.go index 9fc3a8fc5c..9c2da414aa 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/godoc/autocert.go +++ b/cmd/vendor/golang.org/x/tools/cmd/godoc/autocert.go @@ -32,21 +32,28 @@ var ( ) func init() { - serveAutoCertHook = serveAutoCert + runHTTPS = runHTTPSAutocert + certInit = certInitAutocert + wrapHTTPMux = wrapHTTPMuxAutocert } -func serveAutoCert(h http.Handler) error { - m := autocert.Manager{ +var autocertManager *autocert.Manager + +func certInitAutocert() { + autocertManager = &autocert.Manager{ Cache: autocert.DirCache(*autoCertDirFlag), Prompt: autocert.AcceptTOS, } if *autoCertHostFlag != "" { - m.HostPolicy = autocert.HostWhitelist(*autoCertHostFlag) + autocertManager.HostPolicy = autocert.HostWhitelist(*autoCertHostFlag) } +} + +func runHTTPSAutocert(h http.Handler) error { srv := &http.Server{ Handler: h, TLSConfig: &tls.Config{ - GetCertificate: m.GetCertificate, + GetCertificate: autocertManager.GetCertificate, }, IdleTimeout: 60 * time.Second, } @@ -58,6 +65,10 @@ func serveAutoCert(h http.Handler) error { return srv.Serve(tls.NewListener(tcpKeepAliveListener{ln.(*net.TCPListener)}, srv.TLSConfig)) } +func wrapHTTPMuxAutocert(h http.Handler) http.Handler { + return autocertManager.HTTPHandler(h) +} + // tcpKeepAliveListener sets TCP keep-alive timeouts on accepted // connections. It's used by ListenAndServe and ListenAndServeTLS so // dead TCP connections (e.g. closing laptop mid-download) eventually diff --git a/cmd/vendor/golang.org/x/tools/cmd/godoc/blog.go b/cmd/vendor/golang.org/x/tools/cmd/godoc/blog.go index dec4732fc7..e47b73eb09 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/godoc/blog.go +++ b/cmd/vendor/golang.org/x/tools/cmd/godoc/blog.go @@ -34,12 +34,14 @@ var ( func init() { // Initialize blog only when first accessed. http.HandleFunc(blogPath, func(w http.ResponseWriter, r *http.Request) { - blogInitOnce.Do(blogInit) + blogInitOnce.Do(func() { + blogInit(r.Host) + }) blogServer.ServeHTTP(w, r) }) } -func blogInit() { +func blogInit(host string) { // Binary distributions will include the blog content in "/blog". root := filepath.Join(runtime.GOROOT(), "blog") @@ -57,12 +59,13 @@ func blogInit() { } s, err := blog.NewServer(blog.Config{ - BaseURL: blogPath, - BasePath: strings.TrimSuffix(blogPath, "/"), - ContentPath: filepath.Join(root, "content"), - TemplatePath: filepath.Join(root, "template"), - HomeArticles: 5, - PlayEnabled: playEnabled, + BaseURL: blogPath, + BasePath: strings.TrimSuffix(blogPath, "/"), + ContentPath: filepath.Join(root, "content"), + TemplatePath: filepath.Join(root, "template"), + HomeArticles: 5, + PlayEnabled: playEnabled, + ServeLocalLinks: strings.HasPrefix(host, "localhost"), }) if err != nil { log.Fatal(err) diff --git a/cmd/vendor/golang.org/x/tools/cmd/godoc/handlers.go b/cmd/vendor/golang.org/x/tools/cmd/godoc/handlers.go index 6691ed723b..137709bd21 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/godoc/handlers.go +++ b/cmd/vendor/golang.org/x/tools/cmd/godoc/handlers.go @@ -120,6 +120,7 @@ func readTemplates(p *godoc.Presentation, html bool) { p.ImplementsHTML = readTemplate("implements.html") p.MethodSetHTML = readTemplate("methodset.html") p.PackageHTML = readTemplate("package.html") + p.PackageRootHTML = readTemplate("packageroot.html") p.SearchHTML = readTemplate("search.html") p.SearchDocHTML = readTemplate("searchdoc.html") p.SearchCodeHTML = readTemplate("searchcode.html") diff --git a/cmd/vendor/golang.org/x/tools/cmd/godoc/main.go b/cmd/vendor/golang.org/x/tools/cmd/godoc/main.go index 901e992a15..5e5bc22513 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/godoc/main.go +++ b/cmd/vendor/golang.org/x/tools/cmd/godoc/main.go @@ -72,6 +72,7 @@ var ( // layout control html = flag.Bool("html", false, "print HTML in command-line mode") srcMode = flag.Bool("src", false, "print (exported) source in command-line mode") + allMode = flag.Bool("all", false, "include unexported identifiers in command-line mode") urlFlag = flag.String("url", "", "print HTML for named URL") // command-line searches @@ -164,6 +165,10 @@ func main() { flag.Usage = usage flag.Parse() + if certInit != nil { + certInit() + } + playEnabled = *showPlayground // Check usage: server and no args. @@ -253,6 +258,7 @@ func main() { pres.DeclLinks = *declLinks pres.SrcMode = *srcMode pres.HTMLMode = *html + pres.AllMode = *allMode if *notesRx != "" { pres.NotesRx = regexp.MustCompile(*notesRx) } @@ -323,9 +329,9 @@ func main() { go analysis.Run(pointerAnalysis, &corpus.Analysis) } - if serveAutoCertHook != nil { + if runHTTPS != nil { go func() { - if err := serveAutoCertHook(handler); err != nil { + if err := runHTTPS(handler); err != nil { log.Fatalf("ListenAndServe TLS: %v", err) } }() @@ -335,6 +341,9 @@ func main() { if *verbose { log.Println("starting HTTP server") } + if wrapHTTPMux != nil { + handler = wrapHTTPMux(handler) + } if err := http.ListenAndServe(*httpAddr, handler); err != nil { log.Fatalf("ListenAndServe %s: %v", *httpAddr, err) } @@ -352,6 +361,10 @@ func main() { } } -// serveAutoCertHook if non-nil specifies a function to listen on port 443. -// See autocert.go. -var serveAutoCertHook func(http.Handler) error +// Hooks that are set non-nil in autocert.go if the "autocert" build tag +// is used. +var ( + certInit func() + runHTTPS func(http.Handler) error + wrapHTTPMux func(http.Handler) http.Handler +) diff --git a/cmd/vendor/golang.org/x/tools/cmd/godoc/x.go b/cmd/vendor/golang.org/x/tools/cmd/godoc/x.go index 13e600c7f3..0e51ea8172 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/godoc/x.go +++ b/cmd/vendor/golang.org/x/tools/cmd/godoc/x.go @@ -22,9 +22,9 @@ type xRepo struct { } var xMap = map[string]xRepo{ - "codereview": {"https://code.google.com/p/go.codereview", "hg"}, + "codereview": {"https://code.google.com/p/go.codereview", "hg"}, // Not included at https://golang.org/pkg/#subrepo. - "arch": {"https://go.googlesource.com/arch", "git"}, + "arch": {"https://go.googlesource.com/arch", "git"}, // Not included at https://golang.org/pkg/#subrepo. "benchmarks": {"https://go.googlesource.com/benchmarks", "git"}, "blog": {"https://go.googlesource.com/blog", "git"}, "build": {"https://go.googlesource.com/build", "git"}, @@ -32,20 +32,22 @@ var xMap = map[string]xRepo{ "debug": {"https://go.googlesource.com/debug", "git"}, "exp": {"https://go.googlesource.com/exp", "git"}, "image": {"https://go.googlesource.com/image", "git"}, + "lint": {"https://go.googlesource.com/lint", "git"}, // Not included at https://golang.org/pkg/#subrepo. "mobile": {"https://go.googlesource.com/mobile", "git"}, "net": {"https://go.googlesource.com/net", "git"}, - "oauth2": {"https://go.googlesource.com/oauth2", "git"}, + "oauth2": {"https://go.googlesource.com/oauth2", "git"}, // Not included at https://golang.org/pkg/#subrepo. "perf": {"https://go.googlesource.com/perf", "git"}, - "playground": {"https://go.googlesource.com/playground", "git"}, + "playground": {"https://go.googlesource.com/playground", "git"}, // Not included at https://golang.org/pkg/#subrepo. "review": {"https://go.googlesource.com/review", "git"}, "sync": {"https://go.googlesource.com/sync", "git"}, "sys": {"https://go.googlesource.com/sys", "git"}, - "talks": {"https://go.googlesource.com/talks", "git"}, - "term": {"https://go.googlesource.com/term", "git"}, + "talks": {"https://go.googlesource.com/talks", "git"}, // Not included at https://golang.org/pkg/#subrepo. + "term": {"https://go.googlesource.com/term", "git"}, // Not included at https://golang.org/pkg/#subrepo. "text": {"https://go.googlesource.com/text", "git"}, "time": {"https://go.googlesource.com/time", "git"}, "tools": {"https://go.googlesource.com/tools", "git"}, "tour": {"https://go.googlesource.com/tour", "git"}, + "vgo": {"https://go.googlesource.com/vgo", "git"}, // Not included at https://golang.org/pkg/#subrepo. } func init() { diff --git a/cmd/vendor/golang.org/x/tools/cmd/goimports/goimports.go b/cmd/vendor/golang.org/x/tools/cmd/goimports/goimports.go index 16e30834f0..0ce85c9c32 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/goimports/goimports.go +++ b/cmd/vendor/golang.org/x/tools/cmd/goimports/goimports.go @@ -47,7 +47,7 @@ var ( func init() { flag.BoolVar(&options.AllErrors, "e", false, "report all errors (not just the first 10 on different lines)") - flag.StringVar(&imports.LocalPrefix, "local", "", "put imports beginning with this string after 3rd-party packages") + flag.StringVar(&imports.LocalPrefix, "local", "", "put imports beginning with this string after 3rd-party packages; comma-separated list") } func report(err error) { diff --git a/cmd/vendor/golang.org/x/tools/cmd/guru/referrers.go b/cmd/vendor/golang.org/x/tools/cmd/guru/referrers.go index d6b9df90ee..1a4b3bd24a 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/guru/referrers.go +++ b/cmd/vendor/golang.org/x/tools/cmd/guru/referrers.go @@ -34,6 +34,12 @@ func referrers(q *Query) error { return err } + // Load tests of the query package + // even if the query location is not in the tests. + for path := range lconf.ImportPkgs { + lconf.ImportPkgs[path] = true + } + // Load/parse/type-check the query package. lprog, err := lconf.Load() if err != nil { diff --git a/cmd/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/main.go b/cmd/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/main.go index 1fc80ea220..acaae1fe96 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/main.go +++ b/cmd/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/main.go @@ -25,6 +25,8 @@ func main() { s2.f = 1 } +var notexported int // @referrers unexported-from-test "notexported" + // Test //line directives: type U int // @referrers ref-type-U "U" diff --git a/cmd/vendor/golang.org/x/tools/cmd/tip/talks.go b/cmd/vendor/golang.org/x/tools/cmd/tip/talks.go index 3fc9e1e4c3..a1a7a95551 100644 --- a/cmd/vendor/golang.org/x/tools/cmd/tip/talks.go +++ b/cmd/vendor/golang.org/x/tools/cmd/tip/talks.go @@ -21,7 +21,7 @@ func (b talksBuilder) Signature(heads map[string]string) string { return heads["talks"] } -const talksToolsRev = "e04df2157ae7263e17159baabadc99fb03fc7514" +const talksToolsRev = "8cab8a1319f0be9798e7fe78b15da75e5f94b2e9" func (b talksBuilder) Init(dir, hostport string, heads map[string]string) (*exec.Cmd, error) { toolsDir := filepath.Join(dir, "gopath/src/golang.org/x/tools") diff --git a/cmd/vendor/golang.org/x/tools/go/callgraph/cha/cha.go b/cmd/vendor/golang.org/x/tools/go/callgraph/cha/cha.go index 68ffffebd7..215ff173d9 100644 --- a/cmd/vendor/golang.org/x/tools/go/callgraph/cha/cha.go +++ b/cmd/vendor/golang.org/x/tools/go/callgraph/cha/cha.go @@ -47,23 +47,36 @@ func CallGraph(prog *ssa.Program) *callgraph.Graph { // methodsByName contains all methods, // grouped by name for efficient lookup. + // (methodsById would be better but not every SSA method has a go/types ID.) methodsByName := make(map[string][]*ssa.Function) - // methodsMemo records, for every abstract method call call I.f on - // interface type I, the set of concrete methods C.f of all + // An imethod represents an interface method I.m. + // (There's no go/types object for it; + // a *types.Func may be shared by many interfaces due to interface embedding.) + type imethod struct { + I *types.Interface + id string + } + // methodsMemo records, for every abstract method call I.m on + // interface type I, the set of concrete methods C.m of all // types C that satisfy interface I. - methodsMemo := make(map[*types.Func][]*ssa.Function) - lookupMethods := func(m *types.Func) []*ssa.Function { - methods, ok := methodsMemo[m] + // + // Abstract methods may be shared by several interfaces, + // hence we must pass I explicitly, not guess from m. + // + // methodsMemo is just a cache, so it needn't be a typeutil.Map. + methodsMemo := make(map[imethod][]*ssa.Function) + lookupMethods := func(I *types.Interface, m *types.Func) []*ssa.Function { + id := m.Id() + methods, ok := methodsMemo[imethod{I, id}] if !ok { - I := m.Type().(*types.Signature).Recv().Type().Underlying().(*types.Interface) for _, f := range methodsByName[m.Name()] { C := f.Signature.Recv().Type() // named or *named if types.Implements(C, I) { methods = append(methods, f) } } - methodsMemo[m] = methods + methodsMemo[imethod{I, id}] = methods } return methods } @@ -109,7 +122,8 @@ func CallGraph(prog *ssa.Program) *callgraph.Graph { if site, ok := instr.(ssa.CallInstruction); ok { call := site.Common() if call.IsInvoke() { - addEdges(fnode, site, lookupMethods(call.Method)) + tiface := call.Value.Type().Underlying().(*types.Interface) + addEdges(fnode, site, lookupMethods(tiface, call.Method)) } else if g := call.StaticCallee(); g != nil { addEdge(fnode, site, g) } else if _, ok := call.Value.(*ssa.Builtin); !ok { diff --git a/cmd/vendor/golang.org/x/tools/go/callgraph/cha/testdata/issue23925.go b/cmd/vendor/golang.org/x/tools/go/callgraph/cha/testdata/issue23925.go new file mode 100644 index 0000000000..59eaf18389 --- /dev/null +++ b/cmd/vendor/golang.org/x/tools/go/callgraph/cha/testdata/issue23925.go @@ -0,0 +1,38 @@ +package main + +// Regression test for https://github.com/golang/go/issues/23925 + +type stringFlagImpl string + +func (*stringFlagImpl) Set(s string) error { return nil } + +type boolFlagImpl bool + +func (*boolFlagImpl) Set(s string) error { return nil } +func (*boolFlagImpl) extra() {} + +// A copy of flag.boolFlag interface, without a dependency. +// Must appear first, so that it becomes the owner of the Set methods. +type boolFlag interface { + flagValue + extra() +} + +// A copy of flag.Value, without adding a dependency. +type flagValue interface { + Set(string) error +} + +func main() { + var x flagValue = new(stringFlagImpl) + x.Set("") + + var y boolFlag = new(boolFlagImpl) + y.Set("") +} + +// WANT: +// Dynamic calls +// main --> (*boolFlagImpl).Set +// main --> (*boolFlagImpl).Set +// main --> (*stringFlagImpl).Set diff --git a/cmd/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/cmd/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go index e53270e061..b44bdbfcf9 100644 --- a/cmd/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ b/cmd/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -7,9 +7,6 @@ // gc compiler. This package supports go1.7 export data format and all // later versions. // -// This package replaces the deprecated golang.org/x/tools/go/gcimporter15 -// package, which will be deleted in October 2017. -// // Although it might seem convenient for this package to live alongside // go/types in the standard library, this would cause version skew // problems for developer tools that use it, since they must be able to @@ -32,7 +29,7 @@ import ( "io" "io/ioutil" - gcimporter "golang.org/x/tools/go/gcimporter15" + "golang.org/x/tools/go/internal/gcimporter" ) // Find returns the name of an object (.o) or archive (.a) file diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/bexport.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/bexport.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/bimport.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go similarity index 89% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/bimport.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go index 1936a7f6c9..3e845eafe3 100644 --- a/cmd/vendor/golang.org/x/tools/go/gcimporter15/bimport.go +++ b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go @@ -39,8 +39,7 @@ type importer struct { posInfoFormat bool prevFile string prevLine int - fset *token.FileSet - files map[string]*token.File + fake fakeFileSet // debugging support debugFormat bool @@ -62,6 +61,10 @@ func BImportData(fset *token.FileSet, imports map[string]*types.Package, data [] } }() + if len(data) > 0 && data[0] == 'i' { + return iImportData(fset, imports, data[1:], path) + } + p := importer{ imports: imports, data: data, @@ -69,8 +72,10 @@ func BImportData(fset *token.FileSet, imports map[string]*types.Package, data [] version: -1, // unknown version strList: []string{""}, // empty string is mapped to 0 pathList: []string{""}, // empty string is mapped to 0 - fset: fset, - files: make(map[string]*token.File), + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, } // read version info @@ -104,10 +109,10 @@ func BImportData(fset *token.FileSet, imports map[string]*types.Package, data [] // read version specific flags - extend as necessary switch p.version { - // case 6: + // case 7: // ... // fallthrough - case 5, 4, 3, 2, 1: + case 6, 5, 4, 3, 2, 1: p.debugFormat = p.rawStringln(p.rawByte()) == "debug" p.trackAllTypes = p.int() != 0 p.posInfoFormat = p.int() != 0 @@ -125,7 +130,7 @@ func BImportData(fset *token.FileSet, imports map[string]*types.Package, data [] // read package data pkg = p.pkg() - // read objects of phase 1 only (see cmd/compiler/internal/gc/bexport.go) + // read objects of phase 1 only (see cmd/compile/internal/gc/bexport.go) objcount := 0 for { tag := p.tagOrIndex() @@ -184,6 +189,9 @@ func (p *importer) pkg() *types.Package { } else { path = p.string() } + if p.version >= 6 { + p.int() // package height; unused by go/types + } // we should never see an empty package name if name == "" { @@ -259,7 +267,7 @@ func (p *importer) obj(tag int) { case constTag: pos := p.pos() pkg, name := p.qualifiedName() - typ := p.typ(nil) + typ := p.typ(nil, nil) val := p.value() p.declare(types.NewConst(pos, pkg, name, typ, val)) @@ -267,16 +275,16 @@ func (p *importer) obj(tag int) { // TODO(gri) verify type alias hookup is correct pos := p.pos() pkg, name := p.qualifiedName() - typ := p.typ(nil) + typ := p.typ(nil, nil) p.declare(types.NewTypeName(pos, pkg, name, typ)) case typeTag: - p.typ(nil) + p.typ(nil, nil) case varTag: pos := p.pos() pkg, name := p.qualifiedName() - typ := p.typ(nil) + typ := p.typ(nil, nil) p.declare(types.NewVar(pos, pkg, name, typ)) case funcTag: @@ -323,15 +331,23 @@ func (p *importer) pos() token.Pos { p.prevFile = file p.prevLine = line - // Synthesize a token.Pos + return p.fake.pos(file, line) +} +// Synthesize a token.Pos +type fakeFileSet struct { + fset *token.FileSet + files map[string]*token.File +} + +func (s *fakeFileSet) pos(file string, line int) token.Pos { // Since we don't know the set of needed file positions, we // reserve maxlines positions per file. const maxlines = 64 * 1024 - f := p.files[file] + f := s.files[file] if f == nil { - f = p.fset.AddFile(file, -1, maxlines) - p.files[file] = f + f = s.fset.AddFile(file, -1, maxlines) + s.files[file] = f // Allocate the fake linebreak indices on first use. // TODO(adonovan): opt: save ~512KB using a more complex scheme? fakeLinesOnce.Do(func() { @@ -381,7 +397,11 @@ func (t *dddSlice) String() string { return "..." + t.elem.String() } // the package currently imported. The parent package is needed for // exported struct fields and interface methods which don't contain // explicit package information in the export data. -func (p *importer) typ(parent *types.Package) types.Type { +// +// A non-nil tname is used as the "owner" of the result type; i.e., +// the result type is the underlying type of tname. tname is used +// to give interface methods a named receiver type where possible. +func (p *importer) typ(parent *types.Package, tname *types.Named) types.Type { // if the type was seen before, i is its index (>= 0) i := p.tagOrIndex() if i >= 0 { @@ -411,15 +431,15 @@ func (p *importer) typ(parent *types.Package) types.Type { t0 := types.NewNamed(obj.(*types.TypeName), nil, nil) // but record the existing type, if any - t := obj.Type().(*types.Named) - p.record(t) + tname := obj.Type().(*types.Named) // tname is either t0 or the existing type + p.record(tname) // read underlying type - t0.SetUnderlying(p.typ(parent)) + t0.SetUnderlying(p.typ(parent, t0)) // interfaces don't have associated methods if types.IsInterface(t0) { - return t + return tname } // read associated methods @@ -440,7 +460,7 @@ func (p *importer) typ(parent *types.Package) types.Type { t0.AddMethod(types.NewFunc(pos, parent, name, sig)) } - return t + return tname case arrayTag: t := new(types.Array) @@ -449,7 +469,7 @@ func (p *importer) typ(parent *types.Package) types.Type { } n := p.int64() - *t = *types.NewArray(p.typ(parent), n) + *t = *types.NewArray(p.typ(parent, nil), n) return t case sliceTag: @@ -458,7 +478,7 @@ func (p *importer) typ(parent *types.Package) types.Type { p.record(t) } - *t = *types.NewSlice(p.typ(parent)) + *t = *types.NewSlice(p.typ(parent, nil)) return t case dddTag: @@ -467,7 +487,7 @@ func (p *importer) typ(parent *types.Package) types.Type { p.record(t) } - t.elem = p.typ(parent) + t.elem = p.typ(parent, nil) return t case structTag: @@ -485,7 +505,7 @@ func (p *importer) typ(parent *types.Package) types.Type { p.record(t) } - *t = *types.NewPointer(p.typ(parent)) + *t = *types.NewPointer(p.typ(parent, nil)) return t case signatureTag: @@ -504,6 +524,8 @@ func (p *importer) typ(parent *types.Package) types.Type { // cannot expect the interface type to appear in a cycle, as any // such cycle must contain a named type which would have been // first defined earlier. + // TODO(gri) Is this still true now that we have type aliases? + // See issue #23225. n := len(p.typList) if p.trackAllTypes { p.record(nil) @@ -512,10 +534,10 @@ func (p *importer) typ(parent *types.Package) types.Type { var embeddeds []*types.Named for n := p.int(); n > 0; n-- { p.pos() - embeddeds = append(embeddeds, p.typ(parent).(*types.Named)) + embeddeds = append(embeddeds, p.typ(parent, nil).(*types.Named)) } - t := types.NewInterface(p.methodList(parent), embeddeds) + t := types.NewInterface(p.methodList(parent, tname), embeddeds) p.interfaceList = append(p.interfaceList, t) if p.trackAllTypes { p.typList[n] = t @@ -528,8 +550,8 @@ func (p *importer) typ(parent *types.Package) types.Type { p.record(t) } - key := p.typ(parent) - val := p.typ(parent) + key := p.typ(parent, nil) + val := p.typ(parent, nil) *t = *types.NewMap(key, val) return t @@ -539,19 +561,8 @@ func (p *importer) typ(parent *types.Package) types.Type { p.record(t) } - var dir types.ChanDir - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d := p.int(); d { - case 1 /* Crecv */ : - dir = types.RecvOnly - case 2 /* Csend */ : - dir = types.SendOnly - case 3 /* Cboth */ : - dir = types.SendRecv - default: - errorf("unexpected channel dir %d", d) - } - val := p.typ(parent) + dir := chanDir(p.int()) + val := p.typ(parent, nil) *t = *types.NewChan(dir, val) return t @@ -561,6 +572,21 @@ func (p *importer) typ(parent *types.Package) types.Type { } } +func chanDir(d int) types.ChanDir { + // tag values must match the constants in cmd/compile/internal/gc/go.go + switch d { + case 1 /* Crecv */ : + return types.RecvOnly + case 2 /* Csend */ : + return types.SendOnly + case 3 /* Cboth */ : + return types.SendRecv + default: + errorf("unexpected channel dir %d", d) + return 0 + } +} + func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags []string) { if n := p.int(); n > 0 { fields = make([]*types.Var, n) @@ -575,7 +601,7 @@ func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags [ func (p *importer) field(parent *types.Package) (*types.Var, string) { pos := p.pos() pkg, name, alias := p.fieldName(parent) - typ := p.typ(parent) + typ := p.typ(parent, nil) tag := p.string() anonymous := false @@ -599,22 +625,30 @@ func (p *importer) field(parent *types.Package) (*types.Var, string) { return types.NewField(pos, pkg, name, typ, anonymous), tag } -func (p *importer) methodList(parent *types.Package) (methods []*types.Func) { +func (p *importer) methodList(parent *types.Package, baseType *types.Named) (methods []*types.Func) { if n := p.int(); n > 0 { methods = make([]*types.Func, n) for i := range methods { - methods[i] = p.method(parent) + methods[i] = p.method(parent, baseType) } } return } -func (p *importer) method(parent *types.Package) *types.Func { +func (p *importer) method(parent *types.Package, baseType *types.Named) *types.Func { pos := p.pos() pkg, name, _ := p.fieldName(parent) + // If we don't have a baseType, use a nil receiver. + // A receiver using the actual interface type (which + // we don't know yet) will be filled in when we call + // types.Interface.Complete. + var recv *types.Var + if baseType != nil { + recv = types.NewVar(token.NoPos, parent, "", baseType) + } params, isddd := p.paramList() result, _ := p.paramList() - sig := types.NewSignature(nil, params, result, isddd) + sig := types.NewSignature(recv, params, result, isddd) return types.NewFunc(pos, pkg, name, sig) } @@ -670,7 +704,7 @@ func (p *importer) paramList() (*types.Tuple, bool) { } func (p *importer) param(named bool) (*types.Var, bool) { - t := p.typ(nil) + t := p.typ(nil, nil) td, isddd := t.(*dddSlice) if isddd { t = types.NewSlice(td.elem) diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/exportdata.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/exportdata.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/gcimporter.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go similarity index 99% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/gcimporter.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go index 6fbc9d7617..58e558c959 100644 --- a/cmd/vendor/golang.org/x/tools/go/gcimporter15/gcimporter.go +++ b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go @@ -6,14 +6,10 @@ // but it also contains the original source-based importer code for Go1.6. // Once we stop supporting 1.6, we can remove that code. -// Package gcimporter15 provides various functions for reading +// Package gcimporter provides various functions for reading // gc-generated object files that can be used to implement the // Importer interface defined by the Go 1.5 standard library package. -// -// Deprecated: this package will be deleted in October 2017. -// New code should use golang.org/x/tools/go/gcexportdata. -// -package gcimporter // import "golang.org/x/tools/go/gcimporter15" +package gcimporter // import "golang.org/x/tools/go/internal/gcimporter" import ( "bufio" diff --git a/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go new file mode 100644 index 0000000000..dfc00a3320 --- /dev/null +++ b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go @@ -0,0 +1,585 @@ +// 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. + +// Indexed package import. +// See cmd/compile/internal/gc/iexport.go for the export data format. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "go/constant" + "go/token" + "go/types" + "io" + "sort" +) + +type intReader struct { + *bytes.Reader + path string +} + +func (r *intReader) int64() int64 { + i, err := binary.ReadVarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +func (r *intReader) uint64() uint64 { + i, err := binary.ReadUvarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +const predeclReserved = 32 + +type itag uint64 + +const ( + // Types + definedType itag = iota + pointerType + sliceType + arrayType + chanType + mapType + signatureType + structType + interfaceType +) + +// iImportData imports a package from the serialized package data +// and returns the number of bytes consumed and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func iImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + r := &intReader{bytes.NewReader(data), path} + + version := r.uint64() + switch version { + case 0: + default: + errorf("cannot import %q: unknown iexport format version %d", path, version) + } + + sLen := int64(r.uint64()) + dLen := int64(r.uint64()) + + whence, _ := r.Seek(0, io.SeekCurrent) + stringData := data[whence : whence+sLen] + declData := data[whence+sLen : whence+sLen+dLen] + r.Seek(sLen+dLen, io.SeekCurrent) + + p := iimporter{ + ipath: path, + + stringData: stringData, + stringCache: make(map[uint64]string), + pkgCache: make(map[uint64]*types.Package), + + declData: declData, + pkgIndex: make(map[*types.Package]map[string]uint64), + typCache: make(map[uint64]types.Type), + + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, + } + + for i, pt := range predeclared { + p.typCache[uint64(i)] = pt + } + + pkgList := make([]*types.Package, r.uint64()) + for i := range pkgList { + pkgPathOff := r.uint64() + pkgPath := p.stringAt(pkgPathOff) + pkgName := p.stringAt(r.uint64()) + _ = r.uint64() // package height; unused by go/types + + if pkgPath == "" { + pkgPath = path + } + pkg := imports[pkgPath] + if pkg == nil { + pkg = types.NewPackage(pkgPath, pkgName) + imports[pkgPath] = pkg + } else if pkg.Name() != pkgName { + errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) + } + + p.pkgCache[pkgPathOff] = pkg + + nameIndex := make(map[string]uint64) + for nSyms := r.uint64(); nSyms > 0; nSyms-- { + name := p.stringAt(r.uint64()) + nameIndex[name] = r.uint64() + } + + p.pkgIndex[pkg] = nameIndex + pkgList[i] = pkg + } + + localpkg := pkgList[0] + + names := make([]string, 0, len(p.pkgIndex[localpkg])) + for name := range p.pkgIndex[localpkg] { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + p.doDecl(localpkg, name) + } + + for _, typ := range p.interfaceList { + typ.Complete() + } + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), pkgList[1:]...) + sort.Sort(byPath(list)) + localpkg.SetImports(list) + + // package was imported completely and without errors + localpkg.MarkComplete() + + consumed, _ := r.Seek(0, io.SeekCurrent) + return int(consumed), localpkg, nil +} + +type iimporter struct { + ipath string + + stringData []byte + stringCache map[uint64]string + pkgCache map[uint64]*types.Package + + declData []byte + pkgIndex map[*types.Package]map[string]uint64 + typCache map[uint64]types.Type + + fake fakeFileSet + interfaceList []*types.Interface +} + +func (p *iimporter) doDecl(pkg *types.Package, name string) { + // See if we've already imported this declaration. + if obj := pkg.Scope().Lookup(name); obj != nil { + return + } + + off, ok := p.pkgIndex[pkg][name] + if !ok { + errorf("%v.%v not in index", pkg, name) + } + + r := &importReader{p: p, currPkg: pkg} + r.declReader.Reset(p.declData[off:]) + + r.obj(name) +} + +func (p *iimporter) stringAt(off uint64) string { + if s, ok := p.stringCache[off]; ok { + return s + } + + slen, n := binary.Uvarint(p.stringData[off:]) + if n <= 0 { + errorf("varint failed") + } + spos := off + uint64(n) + s := string(p.stringData[spos : spos+slen]) + p.stringCache[off] = s + return s +} + +func (p *iimporter) pkgAt(off uint64) *types.Package { + if pkg, ok := p.pkgCache[off]; ok { + return pkg + } + path := p.stringAt(off) + errorf("missing package %q in %q", path, p.ipath) + return nil +} + +func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { + if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) { + return t + } + + if off < predeclReserved { + errorf("predeclared type missing from cache: %v", off) + } + + r := &importReader{p: p} + r.declReader.Reset(p.declData[off-predeclReserved:]) + t := r.doType(base) + + if base == nil || !isInterface(t) { + p.typCache[off] = t + } + return t +} + +type importReader struct { + p *iimporter + declReader bytes.Reader + currPkg *types.Package + prevFile string + prevLine int64 +} + +func (r *importReader) obj(name string) { + tag := r.byte() + pos := r.pos() + + switch tag { + case 'A': + typ := r.typ() + + r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) + + case 'C': + typ, val := r.value() + + r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) + + case 'F': + sig := r.signature(nil) + + r.declare(types.NewFunc(pos, r.currPkg, name, sig)) + + case 'T': + // Types can be recursive. We need to setup a stub + // declaration before recursing. + obj := types.NewTypeName(pos, r.currPkg, name, nil) + named := types.NewNamed(obj, nil, nil) + r.declare(obj) + + underlying := r.p.typAt(r.uint64(), named).Underlying() + named.SetUnderlying(underlying) + + if !isInterface(underlying) { + for n := r.uint64(); n > 0; n-- { + mpos := r.pos() + mname := r.ident() + recv := r.param() + msig := r.signature(recv) + + named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) + } + } + + case 'V': + typ := r.typ() + + r.declare(types.NewVar(pos, r.currPkg, name, typ)) + + default: + errorf("unexpected tag: %v", tag) + } +} + +func (r *importReader) declare(obj types.Object) { + obj.Pkg().Scope().Insert(obj) +} + +func (r *importReader) value() (typ types.Type, val constant.Value) { + typ = r.typ() + + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { + case types.IsBoolean: + val = constant.MakeBool(r.bool()) + + case types.IsString: + val = constant.MakeString(r.string()) + + case types.IsInteger: + val = r.mpint(b) + + case types.IsFloat: + val = r.mpfloat(b) + + case types.IsComplex: + re := r.mpfloat(b) + im := r.mpfloat(b) + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + default: + errorf("unexpected type %v", typ) // panics + panic("unreachable") + } + + return +} + +func intSize(b *types.Basic) (signed bool, maxBytes uint) { + if (b.Info() & types.IsUntyped) != 0 { + return true, 64 + } + + switch b.Kind() { + case types.Float32, types.Complex64: + return true, 3 + case types.Float64, types.Complex128: + return true, 7 + } + + signed = (b.Info() & types.IsUnsigned) == 0 + switch b.Kind() { + case types.Int8, types.Uint8: + maxBytes = 1 + case types.Int16, types.Uint16: + maxBytes = 2 + case types.Int32, types.Uint32: + maxBytes = 4 + default: + maxBytes = 8 + } + + return +} + +func (r *importReader) mpint(b *types.Basic) constant.Value { + signed, maxBytes := intSize(b) + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + n, _ := r.declReader.ReadByte() + if uint(n) < maxSmall { + v := int64(n) + if signed { + v >>= 1 + if n&1 != 0 { + v = ^v + } + } + return constant.MakeInt64(v) + } + + v := -n + if signed { + v = -(n &^ 1) >> 1 + } + if v < 1 || uint(v) > maxBytes { + errorf("weird decoding: %v, %v => %v", n, signed, v) + } + + buf := make([]byte, v) + io.ReadFull(&r.declReader, buf) + + // convert to little endian + // TODO(gri) go/constant should have a more direct conversion function + // (e.g., once it supports a big.Float based implementation) + for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 { + buf[i], buf[j] = buf[j], buf[i] + } + + x := constant.MakeFromBytes(buf) + if signed && n&1 != 0 { + x = constant.UnaryOp(token.SUB, x, 0) + } + return x +} + +func (r *importReader) mpfloat(b *types.Basic) constant.Value { + x := r.mpint(b) + if constant.Sign(x) == 0 { + return x + } + + exp := r.int64() + switch { + case exp > 0: + x = constant.Shift(x, token.SHL, uint(exp)) + case exp < 0: + d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) + x = constant.BinaryOp(x, token.QUO, d) + } + return x +} + +func (r *importReader) ident() string { + return r.string() +} + +func (r *importReader) qualifiedIdent() (*types.Package, string) { + name := r.string() + pkg := r.pkg() + return pkg, name +} + +func (r *importReader) pos() token.Pos { + delta := r.int64() + if delta != deltaNewFile { + r.prevLine += delta + } else if l := r.int64(); l == -1 { + r.prevLine += deltaNewFile + } else { + r.prevFile = r.string() + r.prevLine = l + } + + if r.prevFile == "" && r.prevLine == 0 { + return token.NoPos + } + + return r.p.fake.pos(r.prevFile, int(r.prevLine)) +} + +func (r *importReader) typ() types.Type { + return r.p.typAt(r.uint64(), nil) +} + +func isInterface(t types.Type) bool { + _, ok := t.(*types.Interface) + return ok +} + +func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } +func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } + +func (r *importReader) doType(base *types.Named) types.Type { + switch k := r.kind(); k { + default: + errorf("unexpected kind tag in %q: %v", r.p.ipath, k) + return nil + + case definedType: + pkg, name := r.qualifiedIdent() + r.p.doDecl(pkg, name) + return pkg.Scope().Lookup(name).(*types.TypeName).Type() + case pointerType: + return types.NewPointer(r.typ()) + case sliceType: + return types.NewSlice(r.typ()) + case arrayType: + n := r.uint64() + return types.NewArray(r.typ(), int64(n)) + case chanType: + dir := chanDir(int(r.uint64())) + return types.NewChan(dir, r.typ()) + case mapType: + return types.NewMap(r.typ(), r.typ()) + case signatureType: + r.currPkg = r.pkg() + return r.signature(nil) + + case structType: + r.currPkg = r.pkg() + + fields := make([]*types.Var, r.uint64()) + tags := make([]string, len(fields)) + for i := range fields { + fpos := r.pos() + fname := r.ident() + ftyp := r.typ() + emb := r.bool() + tag := r.string() + + fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + tags[i] = tag + } + return types.NewStruct(fields, tags) + + case interfaceType: + r.currPkg = r.pkg() + + embeddeds := make([]*types.Named, r.uint64()) + for i := range embeddeds { + _ = r.pos() + embeddeds[i] = r.typ().(*types.Named) + } + + methods := make([]*types.Func, r.uint64()) + for i := range methods { + mpos := r.pos() + mname := r.ident() + + // TODO(mdempsky): Matches bimport.go, but I + // don't agree with this. + var recv *types.Var + if base != nil { + recv = types.NewVar(token.NoPos, r.currPkg, "", base) + } + + msig := r.signature(recv) + methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) + } + + typ := types.NewInterface(methods, embeddeds) + r.p.interfaceList = append(r.p.interfaceList, typ) + return typ + } +} + +func (r *importReader) kind() itag { + return itag(r.uint64()) +} + +func (r *importReader) signature(recv *types.Var) *types.Signature { + params := r.paramList() + results := r.paramList() + variadic := params.Len() > 0 && r.bool() + return types.NewSignature(recv, params, results, variadic) +} + +func (r *importReader) paramList() *types.Tuple { + xs := make([]*types.Var, r.uint64()) + for i := range xs { + xs[i] = r.param() + } + return types.NewTuple(xs...) +} + +func (r *importReader) param() *types.Var { + pos := r.pos() + name := r.ident() + typ := r.typ() + return types.NewParam(pos, r.currPkg, name, typ) +} + +func (r *importReader) bool() bool { + return r.uint64() != 0 +} + +func (r *importReader) int64() int64 { + n, err := binary.ReadVarint(&r.declReader) + if err != nil { + errorf("readVarint: %v", err) + } + return n +} + +func (r *importReader) uint64() uint64 { + n, err := binary.ReadUvarint(&r.declReader) + if err != nil { + errorf("readUvarint: %v", err) + } + return n +} + +func (r *importReader) byte() byte { + x, err := r.declReader.ReadByte() + if err != nil { + errorf("declReader.ReadByte: %v", err) + } + return x +} diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/isAlias18.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/isAlias18.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/isAlias18.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/isAlias18.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/isAlias19.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/isAlias19.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/isAlias19.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/isAlias19.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/a.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/a.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/a.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/a.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/b.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/b.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/b.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/b.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/exports.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/exports.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/exports.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/exports.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue15920.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/issue15920.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue15920.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/issue15920.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue20046.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/issue20046.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue20046.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/issue20046.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/p.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/p.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/p.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/p.go diff --git a/cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test.go b/cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/versions/test.go similarity index 100% rename from cmd/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test.go rename to cmd/vendor/golang.org/x/tools/go/internal/gcimporter/testdata/versions/test.go diff --git a/cmd/vendor/golang.org/x/tools/go/ssa/interp/external.go b/cmd/vendor/golang.org/x/tools/go/ssa/interp/external.go index 34442caece..2c4dcc76dc 100644 --- a/cmd/vendor/golang.org/x/tools/go/ssa/interp/external.go +++ b/cmd/vendor/golang.org/x/tools/go/ssa/interp/external.go @@ -32,118 +32,119 @@ var externals = make(map[string]externalFn) func init() { // That little dot ۰ is an Arabic zero numeral (U+06F0), categories [Nd]. for k, v := range map[string]externalFn{ - "(*sync.Pool).Get": ext۰sync۰Pool۰Get, - "(*sync.Pool).Put": ext۰nop, - "(reflect.Value).Bool": ext۰reflect۰Value۰Bool, - "(reflect.Value).CanAddr": ext۰reflect۰Value۰CanAddr, - "(reflect.Value).CanInterface": ext۰reflect۰Value۰CanInterface, - "(reflect.Value).Elem": ext۰reflect۰Value۰Elem, - "(reflect.Value).Field": ext۰reflect۰Value۰Field, - "(reflect.Value).Float": ext۰reflect۰Value۰Float, - "(reflect.Value).Index": ext۰reflect۰Value۰Index, - "(reflect.Value).Int": ext۰reflect۰Value۰Int, - "(reflect.Value).Interface": ext۰reflect۰Value۰Interface, - "(reflect.Value).IsNil": ext۰reflect۰Value۰IsNil, - "(reflect.Value).IsValid": ext۰reflect۰Value۰IsValid, - "(reflect.Value).Kind": ext۰reflect۰Value۰Kind, - "(reflect.Value).Len": ext۰reflect۰Value۰Len, - "(reflect.Value).MapIndex": ext۰reflect۰Value۰MapIndex, - "(reflect.Value).MapKeys": ext۰reflect۰Value۰MapKeys, - "(reflect.Value).NumField": ext۰reflect۰Value۰NumField, - "(reflect.Value).NumMethod": ext۰reflect۰Value۰NumMethod, - "(reflect.Value).Pointer": ext۰reflect۰Value۰Pointer, - "(reflect.Value).Set": ext۰reflect۰Value۰Set, - "(reflect.Value).String": ext۰reflect۰Value۰String, - "(reflect.Value).Type": ext۰reflect۰Value۰Type, - "(reflect.Value).Uint": ext۰reflect۰Value۰Uint, - "(reflect.error).Error": ext۰reflect۰error۰Error, - "(reflect.rtype).Bits": ext۰reflect۰rtype۰Bits, - "(reflect.rtype).Elem": ext۰reflect۰rtype۰Elem, - "(reflect.rtype).Field": ext۰reflect۰rtype۰Field, - "(reflect.rtype).In": ext۰reflect۰rtype۰In, - "(reflect.rtype).Kind": ext۰reflect۰rtype۰Kind, - "(reflect.rtype).NumField": ext۰reflect۰rtype۰NumField, - "(reflect.rtype).NumIn": ext۰reflect۰rtype۰NumIn, - "(reflect.rtype).NumMethod": ext۰reflect۰rtype۰NumMethod, - "(reflect.rtype).NumOut": ext۰reflect۰rtype۰NumOut, - "(reflect.rtype).Out": ext۰reflect۰rtype۰Out, - "(reflect.rtype).Size": ext۰reflect۰rtype۰Size, - "(reflect.rtype).String": ext۰reflect۰rtype۰String, - "bytes.init": ext۰nop, // avoid asm dependency - "bytes.Equal": ext۰bytes۰Equal, - "bytes.IndexByte": ext۰bytes۰IndexByte, - "hash/crc32.haveSSE42": ext۰crc32۰haveSSE42, - "internal/cpu.cpuid": ext۰cpu۰cpuid, - "math.Abs": ext۰math۰Abs, - "math.Exp": ext۰math۰Exp, - "math.Float32bits": ext۰math۰Float32bits, - "math.Float32frombits": ext۰math۰Float32frombits, - "math.Float64bits": ext۰math۰Float64bits, - "math.Float64frombits": ext۰math۰Float64frombits, - "math.Ldexp": ext۰math۰Ldexp, - "math.Log": ext۰math۰Log, - "math.Min": ext۰math۰Min, - "math.hasSSE4": ext۰math۰hasSSE4, - "math.hasVectorFacility": ext۰math۰hasVectorFacility, - "os.runtime_args": ext۰os۰runtime_args, - "os.runtime_beforeExit": ext۰nop, - "os/signal.init": ext۰nop, - "reflect.New": ext۰reflect۰New, - "reflect.SliceOf": ext۰reflect۰SliceOf, - "reflect.TypeOf": ext۰reflect۰TypeOf, - "reflect.ValueOf": ext۰reflect۰ValueOf, - "reflect.Zero": ext۰reflect۰Zero, - "reflect.init": ext۰reflect۰Init, - "reflect.valueInterface": ext۰reflect۰valueInterface, - "runtime.Breakpoint": ext۰runtime۰Breakpoint, - "runtime.Caller": ext۰runtime۰Caller, - "runtime.Callers": ext۰runtime۰Callers, - "runtime.FuncForPC": ext۰runtime۰FuncForPC, - "runtime.GC": ext۰runtime۰GC, - "runtime.GOMAXPROCS": ext۰runtime۰GOMAXPROCS, - "runtime.Goexit": ext۰runtime۰Goexit, - "runtime.Gosched": ext۰runtime۰Gosched, - "runtime.init": ext۰nop, - "runtime.KeepAlive": ext۰nop, - "runtime.NumCPU": ext۰runtime۰NumCPU, - "runtime.NumGoroutine": ext۰runtime۰NumGoroutine, - "runtime.ReadMemStats": ext۰runtime۰ReadMemStats, - "runtime.SetFinalizer": ext۰nop, // ignore - "(*runtime.Func).Entry": ext۰runtime۰Func۰Entry, - "(*runtime.Func).FileLine": ext۰runtime۰Func۰FileLine, - "(*runtime.Func).Name": ext۰runtime۰Func۰Name, - "runtime.environ": ext۰runtime۰environ, - "runtime.getgoroot": ext۰runtime۰getgoroot, - "strings.init": ext۰nop, // avoid asm dependency - "strings.Count": ext۰strings۰Count, - "strings.Index": ext۰strings۰Index, - "strings.IndexByte": ext۰strings۰IndexByte, - "sync.runtime_Semacquire": ext۰nop, // unimplementable - "sync.runtime_Semrelease": ext۰nop, // unimplementable - "sync.runtime_Syncsemcheck": ext۰nop, // unimplementable - "sync.runtime_notifyListCheck": ext۰nop, - "sync.runtime_registerPoolCleanup": ext۰nop, - "sync/atomic.AddInt32": ext۰atomic۰AddInt32, - "sync/atomic.AddUint32": ext۰atomic۰AddUint32, - "sync/atomic.CompareAndSwapInt32": ext۰atomic۰CompareAndSwapInt32, - "sync/atomic.CompareAndSwapUint32": ext۰atomic۰CompareAndSwapUint32, - "sync/atomic.LoadInt32": ext۰atomic۰LoadInt32, - "sync/atomic.LoadUint32": ext۰atomic۰LoadUint32, - "sync/atomic.StoreInt32": ext۰atomic۰StoreInt32, - "sync/atomic.StoreUint32": ext۰atomic۰StoreUint32, - "sync/atomic.AddInt64": ext۰atomic۰AddInt64, - "sync/atomic.AddUint64": ext۰atomic۰AddUint64, - "sync/atomic.CompareAndSwapInt64": ext۰atomic۰CompareAndSwapInt64, - "sync/atomic.CompareAndSwapUint64": ext۰atomic۰CompareAndSwapUint64, - "sync/atomic.LoadInt64": ext۰atomic۰LoadInt64, - "sync/atomic.LoadUint64": ext۰atomic۰LoadUint64, - "sync/atomic.StoreInt64": ext۰atomic۰StoreInt64, - "sync/atomic.StoreUint64": ext۰atomic۰StoreUint64, - "(*sync/atomic.Value).Load": ext۰atomic۰ValueLoad, - "(*sync/atomic.Value).Store": ext۰atomic۰ValueStore, - "testing.MainStart": ext۰testing۰MainStart, - "time.Sleep": ext۰time۰Sleep, - "time.now": ext۰time۰now, + "(*sync.Pool).Get": ext۰sync۰Pool۰Get, + "(*sync.Pool).Put": ext۰nop, + "(reflect.Value).Bool": ext۰reflect۰Value۰Bool, + "(reflect.Value).CanAddr": ext۰reflect۰Value۰CanAddr, + "(reflect.Value).CanInterface": ext۰reflect۰Value۰CanInterface, + "(reflect.Value).Elem": ext۰reflect۰Value۰Elem, + "(reflect.Value).Field": ext۰reflect۰Value۰Field, + "(reflect.Value).Float": ext۰reflect۰Value۰Float, + "(reflect.Value).Index": ext۰reflect۰Value۰Index, + "(reflect.Value).Int": ext۰reflect۰Value۰Int, + "(reflect.Value).Interface": ext۰reflect۰Value۰Interface, + "(reflect.Value).IsNil": ext۰reflect۰Value۰IsNil, + "(reflect.Value).IsValid": ext۰reflect۰Value۰IsValid, + "(reflect.Value).Kind": ext۰reflect۰Value۰Kind, + "(reflect.Value).Len": ext۰reflect۰Value۰Len, + "(reflect.Value).MapIndex": ext۰reflect۰Value۰MapIndex, + "(reflect.Value).MapKeys": ext۰reflect۰Value۰MapKeys, + "(reflect.Value).NumField": ext۰reflect۰Value۰NumField, + "(reflect.Value).NumMethod": ext۰reflect۰Value۰NumMethod, + "(reflect.Value).Pointer": ext۰reflect۰Value۰Pointer, + "(reflect.Value).Set": ext۰reflect۰Value۰Set, + "(reflect.Value).String": ext۰reflect۰Value۰String, + "(reflect.Value).Type": ext۰reflect۰Value۰Type, + "(reflect.Value).Uint": ext۰reflect۰Value۰Uint, + "(reflect.error).Error": ext۰reflect۰error۰Error, + "(reflect.rtype).Bits": ext۰reflect۰rtype۰Bits, + "(reflect.rtype).Elem": ext۰reflect۰rtype۰Elem, + "(reflect.rtype).Field": ext۰reflect۰rtype۰Field, + "(reflect.rtype).In": ext۰reflect۰rtype۰In, + "(reflect.rtype).Kind": ext۰reflect۰rtype۰Kind, + "(reflect.rtype).NumField": ext۰reflect۰rtype۰NumField, + "(reflect.rtype).NumIn": ext۰reflect۰rtype۰NumIn, + "(reflect.rtype).NumMethod": ext۰reflect۰rtype۰NumMethod, + "(reflect.rtype).NumOut": ext۰reflect۰rtype۰NumOut, + "(reflect.rtype).Out": ext۰reflect۰rtype۰Out, + "(reflect.rtype).Size": ext۰reflect۰rtype۰Size, + "(reflect.rtype).String": ext۰reflect۰rtype۰String, + "bytes.init": ext۰nop, // avoid asm dependency + "bytes.Equal": ext۰bytes۰Equal, + "bytes.IndexByte": ext۰bytes۰IndexByte, + "hash/crc32.haveSSE42": ext۰crc32۰haveSSE42, + "internal/cpu.cpuid": ext۰cpu۰cpuid, + "internal/syscall/unix.syscall_fcntl": ext۰syscall۰unix۰syscall_fcntl, + "math.Abs": ext۰math۰Abs, + "math.Exp": ext۰math۰Exp, + "math.Float32bits": ext۰math۰Float32bits, + "math.Float32frombits": ext۰math۰Float32frombits, + "math.Float64bits": ext۰math۰Float64bits, + "math.Float64frombits": ext۰math۰Float64frombits, + "math.Ldexp": ext۰math۰Ldexp, + "math.Log": ext۰math۰Log, + "math.Min": ext۰math۰Min, + "math.hasSSE4": ext۰math۰hasSSE4, + "math.hasVectorFacility": ext۰math۰hasVectorFacility, + "os.runtime_args": ext۰os۰runtime_args, + "os.runtime_beforeExit": ext۰nop, + "os/signal.init": ext۰nop, + "reflect.New": ext۰reflect۰New, + "reflect.SliceOf": ext۰reflect۰SliceOf, + "reflect.TypeOf": ext۰reflect۰TypeOf, + "reflect.ValueOf": ext۰reflect۰ValueOf, + "reflect.Zero": ext۰reflect۰Zero, + "reflect.init": ext۰reflect۰Init, + "reflect.valueInterface": ext۰reflect۰valueInterface, + "runtime.Breakpoint": ext۰runtime۰Breakpoint, + "runtime.Caller": ext۰runtime۰Caller, + "runtime.Callers": ext۰runtime۰Callers, + "runtime.FuncForPC": ext۰runtime۰FuncForPC, + "runtime.GC": ext۰runtime۰GC, + "runtime.GOMAXPROCS": ext۰runtime۰GOMAXPROCS, + "runtime.Goexit": ext۰runtime۰Goexit, + "runtime.Gosched": ext۰runtime۰Gosched, + "runtime.init": ext۰nop, + "runtime.KeepAlive": ext۰nop, + "runtime.NumCPU": ext۰runtime۰NumCPU, + "runtime.NumGoroutine": ext۰runtime۰NumGoroutine, + "runtime.ReadMemStats": ext۰runtime۰ReadMemStats, + "runtime.SetFinalizer": ext۰nop, // ignore + "(*runtime.Func).Entry": ext۰runtime۰Func۰Entry, + "(*runtime.Func).FileLine": ext۰runtime۰Func۰FileLine, + "(*runtime.Func).Name": ext۰runtime۰Func۰Name, + "runtime.environ": ext۰runtime۰environ, + "runtime.getgoroot": ext۰runtime۰getgoroot, + "strings.init": ext۰nop, // avoid asm dependency + "strings.Count": ext۰strings۰Count, + "strings.Index": ext۰strings۰Index, + "strings.IndexByte": ext۰strings۰IndexByte, + "sync.runtime_Semacquire": ext۰nop, // unimplementable + "sync.runtime_Semrelease": ext۰nop, // unimplementable + "sync.runtime_Syncsemcheck": ext۰nop, // unimplementable + "sync.runtime_notifyListCheck": ext۰nop, + "sync.runtime_registerPoolCleanup": ext۰nop, + "sync/atomic.AddInt32": ext۰atomic۰AddInt32, + "sync/atomic.AddUint32": ext۰atomic۰AddUint32, + "sync/atomic.CompareAndSwapInt32": ext۰atomic۰CompareAndSwapInt32, + "sync/atomic.CompareAndSwapUint32": ext۰atomic۰CompareAndSwapUint32, + "sync/atomic.LoadInt32": ext۰atomic۰LoadInt32, + "sync/atomic.LoadUint32": ext۰atomic۰LoadUint32, + "sync/atomic.StoreInt32": ext۰atomic۰StoreInt32, + "sync/atomic.StoreUint32": ext۰atomic۰StoreUint32, + "sync/atomic.AddInt64": ext۰atomic۰AddInt64, + "sync/atomic.AddUint64": ext۰atomic۰AddUint64, + "sync/atomic.CompareAndSwapInt64": ext۰atomic۰CompareAndSwapInt64, + "sync/atomic.CompareAndSwapUint64": ext۰atomic۰CompareAndSwapUint64, + "sync/atomic.LoadInt64": ext۰atomic۰LoadInt64, + "sync/atomic.LoadUint64": ext۰atomic۰LoadUint64, + "sync/atomic.StoreInt64": ext۰atomic۰StoreInt64, + "sync/atomic.StoreUint64": ext۰atomic۰StoreUint64, + "(*sync/atomic.Value).Load": ext۰atomic۰ValueLoad, + "(*sync/atomic.Value).Store": ext۰atomic۰ValueStore, + "testing.MainStart": ext۰testing۰MainStart, + "time.Sleep": ext۰time۰Sleep, + "time.now": ext۰time۰now, } { externals[k] = v } @@ -500,6 +501,10 @@ func ext۰cpu۰cpuid(fr *frame, args []value) value { return tuple{uint32(0), uint32(0), uint32(0), uint32(0)} } +func ext۰syscall۰unix۰syscall_fcntl(fr *frame, args []value) value { + return tuple{int(0), wrapError(nil)} +} + // Pretend: type runtime.Func struct { entry *ssa.Function } func ext۰runtime۰Func۰FileLine(fr *frame, args []value) value { diff --git a/cmd/vendor/golang.org/x/tools/go/vcs/vcs.go b/cmd/vendor/golang.org/x/tools/go/vcs/vcs.go index 501c894254..89319be04b 100644 --- a/cmd/vendor/golang.org/x/tools/go/vcs/vcs.go +++ b/cmd/vendor/golang.org/x/tools/go/vcs/vcs.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" "log" + "net/url" "os" "os/exec" "path/filepath" @@ -566,8 +567,8 @@ func RepoRootForImportDynamic(importPath string, verbose bool) (*RepoRoot, error } } - if !strings.Contains(metaImport.RepoRoot, "://") { - return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, metaImport.RepoRoot) + if err := validateRepoRoot(metaImport.RepoRoot); err != nil { + return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, metaImport.RepoRoot, err) } rr := &RepoRoot{ VCS: ByCmd(metaImport.VCS), @@ -580,6 +581,19 @@ func RepoRootForImportDynamic(importPath string, verbose bool) (*RepoRoot, error return rr, nil } +// validateRepoRoot returns an error if repoRoot does not seem to be +// a valid URL with scheme. +func validateRepoRoot(repoRoot string) error { + url, err := url.Parse(repoRoot) + if err != nil { + return err + } + if url.Scheme == "" { + return errors.New("no scheme") + } + return nil +} + // metaImport represents the parsed tags from HTML files. type metaImport struct { diff --git a/cmd/vendor/golang.org/x/tools/godoc/cmdline.go b/cmd/vendor/golang.org/x/tools/godoc/cmdline.go index 7c53681347..b531b4df75 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/cmdline.go +++ b/cmd/vendor/golang.org/x/tools/godoc/cmdline.go @@ -48,6 +48,9 @@ func CommandLine(w io.Writer, fs vfs.NameSpace, pres *Presentation, args []strin // the fake built-in package contains unexported identifiers mode = NoFiltering | NoTypeAssoc } + if pres.AllMode { + mode |= NoFiltering + } if srcMode { // only filter exports if we don't have explicit command-line filter arguments if len(args) > 1 { diff --git a/cmd/vendor/golang.org/x/tools/godoc/dirtrees.go b/cmd/vendor/golang.org/x/tools/godoc/dirtrees.go index 2b14a41e3f..e9483a0b6e 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/dirtrees.go +++ b/cmd/vendor/golang.org/x/tools/godoc/dirtrees.go @@ -13,7 +13,11 @@ import ( "log" "os" pathpkg "path" + "runtime" + "sort" "strings" + + "golang.org/x/tools/godoc/vfs" ) // Conventional name for directories containing test data. @@ -27,6 +31,7 @@ type Directory struct { Name string // directory name HasPkg bool // true if the directory contains at least one package Synopsis string // package documentation, if any + RootType vfs.RootType // root type of the filesystem containing the directory Dirs []*Directory // subdirectories } @@ -55,7 +60,13 @@ type treeBuilder struct { // ioGate is a semaphore controlling VFS activity (ReadDir, parseFile, etc). // Send before an operation and receive after. -var ioGate = make(chan bool, 20) +var ioGate = make(chan struct{}, 20) + +// workGate controls the number of concurrent workers. Too many concurrent +// workers and performance degrades and the race detector gets overwhelmed. If +// we cannot check out a concurrent worker, work is performed by the main thread +// instead of spinning up another goroutine. +var workGate = make(chan struct{}, runtime.NumCPU()*4) func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth int) *Directory { if name == testdataDirName { @@ -88,7 +99,7 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i } } - ioGate <- true + ioGate <- struct{}{} list, err := b.c.fs.ReadDir(path) <-ioGate if err != nil { @@ -101,23 +112,34 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i // determine number of subdirectories and if there are package files var dirchs []chan *Directory + var dirs []*Directory for _, d := range list { filename := pathpkg.Join(path, d.Name()) switch { case isPkgDir(d): - ch := make(chan *Directory, 1) - dirchs = append(dirchs, ch) name := d.Name() - go func() { - ch <- b.newDirTree(fset, filename, name, depth+1) - }() + select { + case workGate <- struct{}{}: + ch := make(chan *Directory, 1) + dirchs = append(dirchs, ch) + go func() { + ch <- b.newDirTree(fset, filename, name, depth+1) + <-workGate + }() + default: + // no free workers, do work synchronously + dir := b.newDirTree(fset, filename, name, depth+1) + if dir != nil { + dirs = append(dirs, dir) + } + } case !haveSummary && isPkgFile(d): // looks like a package file, but may just be a file ending in ".go"; // don't just count it yet (otherwise we may end up with hasPkgFiles even // though the directory doesn't contain any real package files - was bug) // no "optimal" package synopsis yet; continue to collect synopses - ioGate <- true + ioGate <- struct{}{} const flags = parser.ParseComments | parser.PackageClauseOnly file, err := b.c.parseFile(fset, filename, flags) <-ioGate @@ -149,13 +171,18 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i } // create subdirectory tree - var dirs []*Directory for _, ch := range dirchs { if d := <-ch; d != nil { dirs = append(dirs, d) } } + // We need to sort the dirs slice because + // it is appended again after reading from dirchs. + sort.Slice(dirs, func(i, j int) bool { + return dirs[i].Name < dirs[j].Name + }) + // if there are no package files and no subdirectories // containing package files, ignore the directory if !hasPkgFiles && len(dirs) == 0 { @@ -176,6 +203,7 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i Name: name, HasPkg: hasPkgFiles && show, // TODO(bradfitz): add proper Hide field? Synopsis: synopsis, + RootType: b.c.fs.RootType(path), Dirs: dirs, } } @@ -274,12 +302,13 @@ func (dir *Directory) lookup(path string) *Directory { // are useful for presenting an entry in an indented fashion. // type DirEntry struct { - Depth int // >= 0 - Height int // = DirList.MaxHeight - Depth, > 0 - Path string // directory path; includes Name, relative to DirList root - Name string // directory name - HasPkg bool // true if the directory contains at least one package - Synopsis string // package documentation, if any + Depth int // >= 0 + Height int // = DirList.MaxHeight - Depth, > 0 + Path string // directory path; includes Name, relative to DirList root + Name string // directory name + HasPkg bool // true if the directory contains at least one package + Synopsis string // package documentation, if any + RootType vfs.RootType // root type of the filesystem containing the direntry } type DirList struct { @@ -287,6 +316,17 @@ type DirList struct { List []DirEntry } +// hasThirdParty checks whether a list of directory entries has packages outside +// the standard library or not. +func hasThirdParty(list []DirEntry) bool { + for _, entry := range list { + if entry.RootType == vfs.RootTypeGoPath { + return true + } + } + return false +} + // listing creates a (linear) directory listing from a directory tree. // If skipRoot is set, the root directory itself is excluded from the list. // If filter is set, only the directory entries whose paths match the filter @@ -335,6 +375,7 @@ func (root *Directory) listing(skipRoot bool, filter func(string) bool) *DirList p.Name = d.Name p.HasPkg = d.HasPkg p.Synopsis = d.Synopsis + p.RootType = d.RootType list = append(list, p) } diff --git a/cmd/vendor/golang.org/x/tools/godoc/dl/dl.go b/cmd/vendor/golang.org/x/tools/godoc/dl/dl.go index 977ba983fa..f5e6320874 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/dl/dl.go +++ b/cmd/vendor/golang.org/x/tools/godoc/dl/dl.go @@ -48,15 +48,15 @@ func RegisterHandlers(mux *http.ServeMux) { } type File struct { - Filename string - OS string - Arch string - Version string - Checksum string `datastore:",noindex"` // SHA1; deprecated - ChecksumSHA256 string `datastore:",noindex"` - Size int64 `datastore:",noindex"` - Kind string // "archive", "installer", "source" - Uploaded time.Time + Filename string `json:"filename"` + OS string `json:"os"` + Arch string `json:"arch"` + Version string `json:"-"` + Checksum string `json:"-" datastore:",noindex"` // SHA1; deprecated + ChecksumSHA256 string `json:"sha256" datastore:",noindex"` + Size int64 `json:"size" datastore:",noindex"` + Kind string `json:"kind"` // "archive", "installer", "source" + Uploaded time.Time `json:"-"` } func (f File) ChecksumType() string { @@ -137,11 +137,11 @@ func (f File) URL() string { } type Release struct { - Version string - Stable bool - Files []File - Visible bool // show files on page load - SplitPortTable bool // whether files should be split by primary/other ports. + Version string `json:"version"` + Stable bool `json:"stable"` + Files []File `json:"files"` + Visible bool `json:"-"` // show files on page load + SplitPortTable bool `json:"-"` // whether files should be split by primary/other ports. } type Feature struct { @@ -221,6 +221,17 @@ func listHandler(w http.ResponseWriter, r *http.Request) { log.Errorf(c, "cache set error: %v", err) } } + + if r.URL.Query().Get("mode") == "json" { + w.Header().Set("Content-Type", "application/json") + enc := json.NewEncoder(w) + enc.SetIndent("", " ") + if err := enc.Encode(d.Stable); err != nil { + log.Errorf(c, "failed rendering JSON for releases: %v", err) + } + return + } + if err := listTemplate.ExecuteTemplate(w, "root", d); err != nil { log.Errorf(c, "error executing template: %v", err) } diff --git a/cmd/vendor/golang.org/x/tools/godoc/godoc.go b/cmd/vendor/golang.org/x/tools/godoc/godoc.go index d6c27d0b2d..413d582dd5 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/godoc.go +++ b/cmd/vendor/golang.org/x/tools/godoc/godoc.go @@ -106,6 +106,9 @@ func (p *Presentation) initFuncMap() { // formatting of PageInfoMode query string "modeQueryString": modeQueryString, + + // check whether to display third party section or not + "hasThirdParty": hasThirdParty, } if p.URLForSrc != nil { p.funcMap["srcLink"] = p.URLForSrc diff --git a/cmd/vendor/golang.org/x/tools/godoc/index.go b/cmd/vendor/golang.org/x/tools/godoc/index.go index 8cefd1423d..c9b9bd338e 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/index.go +++ b/cmd/vendor/golang.org/x/tools/godoc/index.go @@ -1532,7 +1532,6 @@ func (c *Corpus) RunIndexer() { } // Repeatedly update the package directory tree and index. - // TODO(bgarcia): Use fsnotify to only update when notified of a filesystem change. for { c.initFSTree() c.UpdateIndex() diff --git a/cmd/vendor/golang.org/x/tools/godoc/pres.go b/cmd/vendor/golang.org/x/tools/godoc/pres.go index 855117764e..de23c75635 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/pres.go +++ b/cmd/vendor/golang.org/x/tools/godoc/pres.go @@ -33,6 +33,7 @@ type Presentation struct { ImplementsHTML, MethodSetHTML, PackageHTML, + PackageRootHTML, PackageText, SearchHTML, SearchDocHTML, @@ -53,6 +54,8 @@ type Presentation struct { SrcMode bool // HTMLMode outputs HTML instead of plain text in command-line mode. HTMLMode bool + // AllMode includes unexported identifiers in the output in command-line mode. + AllMode bool // NotesRx optionally specifies a regexp to match // notes to render in the output. diff --git a/cmd/vendor/golang.org/x/tools/godoc/server.go b/cmd/vendor/golang.org/x/tools/godoc/server.go index 95b477545d..9240746d00 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/server.go +++ b/cmd/vendor/golang.org/x/tools/godoc/server.go @@ -200,11 +200,12 @@ func (h *handlerServer) GetPageInfo(abspath, relpath string, mode PageInfoMode, timestamp = ts } if dir == nil { - // no directory tree present (too early after startup or - // command-line mode); compute one level for this page + // no directory tree present (happens in command-line mode); + // compute 2 levels for this page. The second level is to + // get the synopses of sub-directories. // note: cannot use path filter here because in general - // it doesn't contain the FSTree path - dir = h.c.newDirectory(abspath, 1) + // it doesn't contain the FSTree path + dir = h.c.newDirectory(abspath, 2) timestamp = time.Now() } info.Dirs = dir.listing(true, func(path string) bool { return h.includePath(path, mode) }) @@ -320,11 +321,17 @@ func (h *handlerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } info.GoogleCN = googleCN(r) + var body []byte + if info.Dirname == "/src" { + body = applyTemplate(h.p.PackageRootHTML, "packageRootHTML", info) + } else { + body = applyTemplate(h.p.PackageHTML, "packageHTML", info) + } h.p.ServePage(w, Page{ Title: title, Tabtitle: tabtitle, Subtitle: subtitle, - Body: applyTemplate(h.p.PackageHTML, "packageHTML", info), + Body: body, GoogleCN: info.GoogleCN, }) } diff --git a/cmd/vendor/golang.org/x/tools/godoc/static/makestatic.go b/cmd/vendor/golang.org/x/tools/godoc/static/makestatic.go index 8ee8e55658..aedc81a246 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/static/makestatic.go +++ b/cmd/vendor/golang.org/x/tools/godoc/static/makestatic.go @@ -60,6 +60,7 @@ var files = []string{ "methodset.html", "opensearch.xml", "package.html", + "packageroot.html", "package.txt", "play.js", "playground.js", diff --git a/cmd/vendor/golang.org/x/tools/godoc/static/static.go b/cmd/vendor/golang.org/x/tools/godoc/static/static.go index 14739d8068..45478e3c22 100644 --- a/cmd/vendor/golang.org/x/tools/godoc/static/static.go +++ b/cmd/vendor/golang.org/x/tools/godoc/static/static.go @@ -283,7 +283,7 @@ var Files = map[string]string{ "analysis/ident-field.png": "\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03\xd2\x00\x00\x00\xde\b\x03\x00\x00\x00\xe6g\xc8\n\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x02\xfdPLTE\x00\x01\x00\x02\x05\x01\n\x03\x01\x05\b\x03\f\x0e\v\f\x10\x1c\x0e\x11\x14\x10\x12\x0f\r\x15$\x16\x17\x14\x1c\x1b\x15\x1b\x1d\x1a\x1f\x1f\x19\x13#A!# $$\x1d#$\"$%#&'%\x19(G((!'(&+)\x1e\x14+N()'++$*,)/-\"*.0-.,02/63(241685<9-5:=:;9=?=CA5AB@CEBKH|u]tvsB\x8c@@\x8dG\\z\xbby{x]~\xb7e|\xb8K\x90J\x85}e_\x80\xba}\u007f|O\x93Nb\x83\xbdN\x95Ud\x85\xbf\x81\x83\x80W\x95Vl\x87\xbc\x90\x86hZ\x98Yo\x89\xbf\x87\x89\x86]\x9c\\\\\x9dds\x8dÕ\x8cn\x8b\x8d\x8az\x8e\xbfe\x9ef\x8d\x8f\x8c|\x90\xc1\x9b\x91s\x90\x92\x8fi\xa2i~\x93\xc4x\x95Ā\x94œ\x94\x91\x9f\x95w{\x98\xc7s\xa4lq\xa5s\x95\x97\x94\x82\x9aė\x99\x96\x83\x9cƙ\x9b\x98u\xaaw\xa6\x9b}\x87\x9f\xc9~\xaay\x9c\x9e\x9b\x89\xa1ˀ\xad|\x9f\xa1\x9e\x8f\xa2ǫ\xa1\x82\xa1\xa3\xa0\xa2\xa4\xa1\x92\xa5ʂ\xb1\x85\xa5\xa7\xa4\x8a\xb2\x87\xb4\xa7\x83\x8b\xb3\x89\x96\xa9Χ\xa9\xa6\x98\xabю\xb6\x8c\xaa\xac\xa9\x9e\xad͍\xb8\x93\xba\xad\x88\xad\xaf\xac\x95\xb9\x95\xa1\xb0Я\xb1\xae\xa3\xb2Ә\xbc\x98\xa5\xb5ճ\xb5\xb2\x9b\xbf\x9bµ\x90\xab\xb7ѵ\xb7\xb4\xa3\xbf\x9d\xa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x1eZ\x17\x1a`\x14`\x92\xa4\x15\xae9Mv\xf7\xcaw0\xa0pؑ,x\x10Q놲\xe9\xe1d!pZԺuӸ\tEML,k\x11\xc320\x17\x1a\x000KҬkN\x8b\xdbw<(P:\xec\xb8-x0\xae\xcc\xc8\xf08\xba\x1e\xd8\x1c\x17\x1e1c\x19\xc7e2\xb1\xacE\x8c\x82\x01\xb9\xd0\x00\x80i\x92\x06\x00`8\x00I\x03@P\x01\x92\x06\x80\xa0\x02$\r\x00A\x05H\x1a\x00\x82\n\x904\x00\x04\x15 i\x00\b*@\xd2\x00\x10T\x80\xa4\x01 \xa8\x00I\x03@P\x01\x92\x06\x80\xa0\x02$\r\x00A\xc5(\x96\xf4\x1c.j^\x93Q\x10\x00\x04\x18\xa3X\xd2Ϊ\xa2)Q\x9dFQ\x00\x10X\x98'i\xd1@\a\xa1\xceC\xbb\nv\x1d2E[U\\\xd0{|\x00\xa3\r\xb3$-\x19\xe8\xa0\xcbŻ\x9aڛv\x15\x9bqg\x93Z\xee\xb0Q\b\x00\x04\x16fIZ6Щ)!7B\xe8.\xa91\xdae\x18\x00I\x03A\x87I\x92f\ft*\x85\xbb\x84\x96\x99qw~\x904\x10t\x98$i\xc6@\xa7\xa3\xb8\xaa\xc3\xd5QS\xdc\xe1-~\x98hઌB\x00 \xb00IҬ\x81\x0e\x9eV\xdb\xed\xfbL\xb9\xa3\xa0+jڡ\xf6^\xa3(\x00\b L\x924c\xa0\xe3\xaa,ir6\x95T\x9ab]\xb9\x8f㸻\x8d\x82\x00 \x800IҌ\x81N\r5\xc6r\x95\x98a0\xdd\x195isU\x90\xf9\x02\x00\xa3\x1c\x93$\xcd\x18\xe8\x14Ѕ2\xf4f\x81\xb7\xf8a\xa2\x963cQ\x0e\x00\x86\x11\x93$\xcd\x18舒>n\x8e\xa4a\xc5\x1b\b2L\x924c\xa0S%\x0e\xbc\xcdX{\x06I\x03A\x87I\x92f\ft\\ϗ\x9cn?]\xf2\xbc\x19KއA\xd2@\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2F0[c\x17\xb7\x19\xc5\x00\xe6\x02\x92\x06\x80\xa0\x02$\r\x00A\x05H\x1a\x00\x82\n\x904\x00\x04\x15 i\x00\b*\xfe?\xb6^u\v\xa5[\x1f\x81\x00\x00\x00\x00IEND\xaeB`\x82", - "analysis/ident-func.png": "\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03\xd2\x00\x00\x00\xda\b\x03\x00\x00\x00}\xf6\x8a\x1c\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x02\xfdPLTE\x00\x01\x00\x01\x04\x00\x02\x05\x01\n\x03\x01\x05\b\x03\t\f\b\t\x0f\x11\x0e\x10\f\x10\x12\x0f\x13\x15\x12\x15\x16\x14\x0f\x17&\x19\x18\x11\x1a\x1a\x13\x1a\x1c\x19\x1c\x1c\x16\x13\x1e7 \x1f\x19!# $$\x1d#$\"$%#'(&)(\"+)\x1e\x14+N++$*,)/-\"-.,.2402/63(241:7+685;9-:;9?<0=?=C@4AB@CEBGE8KH|u]tvsB\x8c@@\x8dG\\z\xbby{x]~\xb7e|\xb8\x84|dK\x90J_\x80\xba}\u007f|O\x93Nb\x83\xbd\x8b\x81cN\x95Ud\x85\xbf\x81\x83\x80W\x95Vl\x87\xbc\x8f\x86hZ\x98Yo\x89\xbe\\\x9a[\x87\x89\x86\x93\x89k^\x9d]\\\x9dds\x8dË\x8d\x8a\x96\x8doz\x8e\xbfe\x9ef\x8d\x8f\x8c|\x90\xc1\x9b\x91s\x90\x92\x8fi\xa2i~\x93\xc4x\x95Ā\x94œ\x94\x91{\x98\xc7s\xa4l\xa0\x96xq\xa5s\x97\x99\x96\x83\x9bţ\x99{\x99\x9b\x98u\xaaw\xa7\x9d~\x87\x9fɜ\x9e\x9b\u007f\xabz\x89\xa1˫\xa0\x82\x9f\xa1\x9e\x8f\xa2ǡ\xa3\xa0\xa2\xa4\xa1\x92\xa5ʂ\xb1\x85\xa5\xa7\xa4\x94\xa8ͳ\xa7\x82\x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ci3Oo\x9f\xf6\xc4bz\xf3\x93\x13\xb3\xcf\xd2ۧy\xc7G\xe4\xea\xf66r\xc9w\xa9\xe7\x92\xef\x855\xc9\xe9\x85U\x0e\x12k\fS\xb0\xe7(\x94\xf5\x95\v\xeeؒ\x9e\xf8\xc8YQҢmh*\t\x84\n\xf3$\r\x98\x85z{\f\xb0\x14 \xe9\xd1\aH\xdaҀ\xa4G\x1f iK\x03\x92\x1eu\\\xa8\xe7\xf3\xdf\xf5\xf9\xf7c\xc0H\x06$=\xea\xc8&\xbb]\x17\x8c\xac\x80\x91\nH\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x05H\x1a\x00,\x85I\x92\xee)v\n\x14\x93O\xae\xb2\xa2}&<\xd3\x04\x00,\x88I\x92v;O\xba0'\xe8\xb3M\\\x055-5\x05\xa0i\x00\b\x00&I\x1a5\xd1gw\xd3G\b\xf6\xd1\xd7\xc3\xc5}\x06I\x00\x000\xc6,IS\xca\xc9s\x8aPs\x01\x95w\xc1\xf0\xf1]\t\x00#\x173%M\x9f#\x88P\xa5\xe0\x13\xab܌\xe7\t\x02\x80\xd50S\xd2%\x95\xf4m\xb7\xf0\x00\xef\xc3&<\x9a\x1f\x00,\x87\x89\x92n\x15\x9f\xdc]\\K\xdfj\x8b}\x19\x03\x00\xe0\x17&J\xbaRt\x82%z\xae\xac\x0e\xb5\x9b;\x00\xb0\"&J\xbaHt(])x\xa1-\x83\xb54\x00\f\x1d\xf3$\xdd\xee\x14\xfdB4;\x89ǻ\xabN\xd8\xf1\x06\x80\xa1c\x9e\xa4[\x9d\xedB\xa0\x8f\xfaΩ\x86\xeb\xd2\x00\x10\x00̓t\xb3\xd3\xe32\xc7UP\xddZ\rw\x8f\x01@ 0Oҭ\xf2v\x98k_A\x19(\x1a\x00\x02\x81y\x92\x06\x00 \b\x80\xa4\x01\xc0R\x80\xa4\x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\xff\xf0Aa\x81\xfa\xfa\xcdF\xd6\x16≛\xc4{\xbcox\xcc\xc0R\x05H\x1a\x18\x04\xa1\x93\xf4\x13\xff9f\xfc\x83B0l\xfc\xab\xbem\x01\x02H\x1a\x18\x04\xa1\x9340P@\xd2\xc0 \x00I\x0f_@\xd2\xc0 \b\x03\x86/F'o\x10\x80\xa4\x01\xc0R\x80\xa4\x01\xc0R\x80\xa4\x01\xc0R\x8cfI\xa7pQ\U000db34c\x00`d1\x9a%\xed\xaa.\x9a\x1a\x05\xeee\x00ka\xa2\xa4E\a:\bu\x1e\xde]\xb0\xfb\xb0)ڪ\xe6,\xef\xe3\x03\x18e\x98&iɁ\x0ej/\xde\xdd\xecj\xde]lƓMj\xb9\xa3F&\x000\xa20MҲ\x03\x9d\x9a\x12\xf2 \x84\x9e\x92\x1a\xa3$A\x00$\rX\r\xb3$\xcd8Щ\x14\x9e\x12Zf\xc6\xd3\xf9AҀ\xd50KҌ\x03\x9d\xf6\xe2\xeavw{\x8d)\x13\xef\x06\xae\xda\xc8\x04\x00F\x14fI\x9au\xa0\x83\x97\xd5N\xe7>S\x9e(莚q\xd8\xd5gd\x05\x00#\a\xb3$\xcd8\xd0qW\x964\xbb\x9aK*Mq]\xb9O~\xf0\x1f\x00X\x01\xb3$\xcd8Щ\xa1\x8e\xb1\xdc%f8\x98\ue31a\xbc\xb5\xdab~\x01\x80эY\x92f\x1c\xe8\x14\b\x97\x86\x1b\n|\xd9\a\x89ZΌM9\x00\b\x1efI\x9aq\xa0#J\xfa\xa49\x92\x86\x1do\xc0Z\x98%iƁN\xb58\xf16c\xef\x19$\rX\r\xb3$\xcd8\xd0q\xbfX\xd2\xe4j*yь-\xef\xa3 i\xc0b\x98&iƁ\x8e\xbbvw\xd1\xee\xda\xd0+\xda\xed:\x99b\xb3\x96\xafz\x000O\xd2\xe63\x87\xe3\xa2ˌ\x8c\x00`d1\x9a%\xed:\tC4`9F\xb3\xa4\x01\xc0\x82\x80\xa4\x01\xc0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fY\\-X\x89'\xd6\x01\x01EU\xc4\xf5\xa0\xaa\b\x10PU\x04\b\xa8*\x02\x04T\x15\x01\x02\xaa\x8a\x00\x01UE\x80\x80\xaa\"@@U\x11 \xa0\xaa\b\x10PU\x04\b\x0eU\x15\x93W\x90h\x1c\xaaj\x04L^A$\xceV\x15\x93W\x10\x1dg\xabJ1y\x05\t\xe3dU1y\x05Qp\xb2\xaa\x02L^A$\x8eW\x15\x93W\x10\x89SU\xc5\xe4\x15$\n\xa7\xaa\x8a\xc9+H\x14\x0eV\x15\x93W\x10\x15\a\xab\x8a\xc9+\x88\x8a\x93UM(y\x05q\vNV5\x91\xe4\x15\f\tr\r\x0eV5\x91\xe4\x15\xdbB\x82\xd2\xd0/\xd2;\x1c\xacj\x02\xc9+\xf6\x85\x04\xa5\xa5_\xa478X\xd5\x04\x92Wl\f\tJK\xbfH/p\xb0\xaa\xd6\xc9+v\x86\x04\xa5\xa5_\xa4\x178YU\xcb\xe4\x15;C\x82R\xeb\x17I\x1f\x8eV\xd5*y\xc5ΐ\xa0\xd4\xfaE҇\x93U\xb5L^\xb15$(\xd5~\x914\xe1`U\xad\x93Wl\r\t\xa2)\xf6\x8b\xa4\t\xa7\xaaJ\x13I^\xb13$(\xe5~\x914\xe1`U\xad\xb13$(\xe5~\x914\xe1dU\xad\x93Wl\f\tJ\xb9_$M8YUk\xec\v\tJ\xb1_$}\xc0Vվ\x90\xa0\x14\xfbE\xd2\apU1$\xc8=\x00W\x15C\x82\xdc\x03tU\x11׀\xaa\"@@U\x11 \xa0\xaa\b\x10PU\x04\b\xa8*\x02\x04T\x15\x01\x02\xaa\x8a\x00\x01UE\x80\x80\xaa\"@@U\x11 \xa0\xaa\b\x10`\xaaڍ!A\xee\x03\xa6\xaa\xf7)}i&\x86\x04\xb9\v\x98\xaa2:\xa3\xc2\x02\x91\x81\x0eLU\xd9;\xff\xde\u05ef\xe1\x04\xc0U\xc0T\x15'\x00.\x04\xa6\xaa\x14'\x00\xee\x03\xa6\xaa8\x01p!0U\xc5\t\x80\v\x81\xa9*\xc5\t\x80\xfb\x80\xa9\xaa\x9c\x00tw\xd2\xee\xfb\xfc\v\x87W7\x00S\xd5\xd0\x04\x00q\x130Uet\xde\xe8y(Ő\xa0\x81\x06LU\xf95\x00o\xdd\xdf\xfbR\xe7\xde\xd5\xec\xeb\xee\xc1\xb51\x15\xb6\x85\x04U\x11B\xb2NŶ\xab\xfc\xad:\xdf7\x03o\x83\xd1K`\xaa\xca\xefi\xfd\x93\xef^\x9fy[|\xdd\xd8\xf6\x93\xe8\x02\xfbB\x82\xce\x06\x02\xeb·y\x8d\x87\xbf`\xc3\x1c\xdf\xf5\x9ek\x10+`\xaaʸ\xfb\x1d\xbd\xf6\xd7\xd0\u05cdsQO\xda\x18\x12D\xf9}\x83{V\xf5*i\xa0\xc1\xe8\xfb\xb5\"\xc9\x02SUq\x06\xe0J\xfc\xe7m\f\t\xa2֪\x9e\xea\xddF\x11\tLU\xc5\x19\x80\xaf\xba\xef\xc69YegH\x10UT\r\xae\x1f\x975v\x9d\x98\x94^\xae\x1c2t\xe1\xc2!ٍ\x0f\x86ț\xad/\x88]\x0fI\n\x98\xaaҞ?\x02\xb03$\x88*\xaa\xceіn_\xaaU\xb1\xa5\a\x0f\x17\xac\xab\xf5\xfa6\x97\xd5\xd3Á\xad\xa4.\x10\xb8\x10\xbb\x1e\x92\x140U\xb5\xb8\x06\xc0\u0590\xa0\x88\xaaͤ9\xfc\xbd\x91\x1c\xa1t\x1d9.\xdaq\x02\x90\x16`\xaajq\r\x80\xcd!AaU畈\x1f\x0f\xb3auq.[8\x19R\x14UM\v0U\xa5=O\x00\xec\f\t\xa2\x11U'\xc9\x1b\xad\x97O\xa4\xb4>\xe32\x1f_\xe5\x11\x1d\xaa\x9a\x16`\xaaj1\x01\xb03$\x88FT\x9d;\x82{\x1e\x1c>\x87ү=e_\x1f\x19=I\x9e\xf6GU\xd3\x02LU\xad.\x02\xb41$\x88FT\xdd.&\xb7[\xf9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\x81\xa9*\xc5\t\x80\xfb\x00\xa6*\xc6V\xb8\x17`\xaabl\x85{\x01\xa6*\xc6V\xb8\x17`\xaabl\x85{\x81\xa6*\xc6V\xb8\x16\x80\xaabl\x85;\x01\xa8*\xc6V\xb8\x13\x88\xaabl\x85+\x01\xa9j_\xc7V`@\x85\x13\x01\xa8j\x8a\xb1\x15I\x90r@\x05҇\x00T5\xb5؊\xe4H-\xa0\x02\xe9K\x00\xaa\x9aZlE\x92\xa4\x12P\x81\xf4)\x10UM)\xb6\"IR\t\xa8@\xfa\x14\x88\xaa\xa6\x14[A\xe9\xe9Y\xf9Z\xc1\x8cohb\xe9\x111\x01\x15\x94\xee,+\xd2\xf2g\f\x13\xf7HM8\xf8\x02I\x17 UM%\xb6\x82\xb6d\x8f[\xb5\xa3\x8e\xf0{\xfd%\x92\x1e\x11\x13PA\x0fdT\xbe\xbdcc>\xe1\xb7XK<\xf8\x02I\x17\x10UM)\xb6\xa2\xa3\xa8\xec\x1e\x1bo\x1b\xaf&\x98\x1e\x11\x1bP\xb1.\x8fK\xba.7\x98l\xf0\x05\x92\x16\x00\xaa\x9aZlE39\x1c~:\xa1\xf4\x88\u0600\x8a\xf3\x85\xc3k6\x1e\x0e\xf2<\xa1\xe4\x82/\x90\xb4\x00MU\x9ajlE=\xd1'\x8e\t\xa5G\x98\x04T\\\xdf0\xbb\x98\xe4\xaf\n&\x1b|\x81\xa4\x05\x80\xaaҔb+vD\ue35ePzDl@š\xc5l\xb5\xeb[}\xeb\x92\r\xbe@\xd2\x02@US\x8b\xad\xb8U\xe0\xe7o\xdd5\xf3\x13K\x8f0\t\xa8\xa8\x13\x93[\xea\xafN6\xf8\x02I\v\x00U\x95$\x1b[A[\xbc\x0foh\xae!\x9biB\xe9\x11\xb1\x01\x15L\xd5\xec\xda\x0f\x9a\xe6\x12>\x17M<\xf8\x02I\x170UM!\xb6\x82ғ\xb3\x87\x0e\x9a(\xaeC\xb1N\x8f0\t\xa8\xa0\xafM\xab+\xd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\xaeE\xd2\xc0T\xd5\xe2\x1a\x00\x9bc+\xf47\xf5\xab+&h$\xb7\x91\x1aZ;\x1ao\xb11\xb4\xa4\xc2؊\xb9\x16I\x03SU\x8bk\x00l\x8e\xadP\xe7\x9f\xf7v\x94\x89\xbba+\xad\x97ו\x8d\xc8!r\x9bz+\xe6Z$\rLUi\xcf\x13\x00\x9bc+\xc2\xfa\xed\xe7\xf3`\x1a\x94\xddGZ\v\x8a\x165\x05\xfcQ\xaab\xaeE\xd2\xc0T\xd5b\x02`sl\x05\xd7o\xf3ה\x16\x88\xc4\n\xbad\x94\xa1\xb5x\"\xff\x1b\x99\xa5\xa8\xca[1\xd7\"i`\xaaju\x11\xa0\xad\xb1\x15~?\xa5\x97xC~\xe1U\xbe\xa6L\\\xd1[\x8b\xf8\xc3\xe0X\xa9\xaaފ\xb9\x16I\x03SUjq\x11\xa0}\xb1\x15\xbc]\xabo\xf2g\xb3?\x88|RP\xdb\xdc\xe4\xf7\x9d4\xb4֑\xd9\xebV\x8cg\x13\x87}j+\xe6Z$\rLU-\xff\x15\x80m\xb1\x15\x8c{5\x83}\xd3\xf6\xb3\x85\t\x9b\x97\x14g\xe7U\x9c4\xb6\x06\xebGkyOn\x1e\xa5\xf9\xd5V̵H\x1a\x98\xaaZM\x000\xb6b\x00\x02SUj\xf9\xaf\x000\xb6b\xc0\x01SU\xcb\t\x002\xf0\x80\xa9\xaa\xe5\x04\x00\x19x\xc0T\x95ZN\x00\x90\x01\aLUq\x02\xe0B`\xaa\x8a\x13\x00\x17\x02SU\x8a\x13\x00\xf7\x01SU\x9c\x00\xb8\x10\x98\xaa\xe2\x04\xc0\x85\xc0T\x95\xe2\x04\xc0}\xa0\xaa\b\x10`\xaa\x8asU\x17\x02SU\x9c\xab\xba\x10\x98\xaaR\x9c\x00\xb8\x0f\x98\xaa\xe2\x04\xc0\x85\xc0T\x15'\x00.\x04\xa6\xaa\x14'\x00\xee\x03\xa6\xaa8\x01p!0U\xc5\t\x80\v\x81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\x11 \xa0\xaa\b\x10PU\x04\b\xa8*\x02\x04T\x15\x01\x02\xaa\x8a\x00\x01UE\x80\x80\xaa\"@@U\x11 \xa0\xaa\b\x10PU\x04\b\xa8*\x02\x04T\x15\x01\xc2\xff\amu\xa3\x1c\xa2\xebff\x00\x00\x00\x00IEND\xaeB`\x82", @@ -478,7 +478,16 @@ var Files = map[string]string{ {{end}} - + + + + + +{{if .Playground}} + +{{end}} +{{with .Version}}{{end}} + @@ -567,18 +576,6 @@ and code is licensed under a BSD license.
- - - - - - -{{if .Playground}} - -{{end}} -{{with .Version}}{{end}} - - @@ -1666,9 +1663,9 @@ function cgAddChild(tree, ul, cgn) {

Overview ▾

{{comment_html .Doc}} + {{example_html $ ""}}
- {{example_html $ ""}}